Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 错误:(19)未找到属性'的资源标识符;appComponentFactory';包装内';安卓&x27;尝试安装ADMOB时_Android_Firebase_Admob - Fatal编程技术网

Android 错误:(19)未找到属性'的资源标识符;appComponentFactory';包装内';安卓&x27;尝试安装ADMOB时

Android 错误:(19)未找到属性'的资源标识符;appComponentFactory';包装内';安卓&x27;尝试安装ADMOB时,android,firebase,admob,Android,Firebase,Admob,我正在尝试在我的应用程序中包含Admob。所以我已经在Admob中注册了我的帐户。我计划在没有Firebase的情况下使用它(但如果需要,我可以这样做)。因此,我遵循以下原则: 我试图将此添加到应用程序中。gradle: compile 'com.google.android.gms:play-services-ads:18.3.0' apply plugin: 'com.android.application' android { configurations.all {

我正在尝试在我的应用程序中包含Admob。所以我已经在Admob中注册了我的帐户。我计划在没有Firebase的情况下使用它(但如果需要,我可以这样做)。因此,我遵循以下原则:

我试图将此添加到应用程序中。gradle

compile 'com.google.android.gms:play-services-ads:18.3.0'
apply plugin: 'com.android.application'

android {

    configurations.all {
        resolutionStrategy.force 'junit:junit:4.12'


    }
    compileSdkVersion 27
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.xxx"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



dependencies {
    repositories {
        mavenCentral()
        jcenter()

        maven {
            url "https://jitpack.io"
        }
    }
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.parse:parse-android:1.14.1'
    compile 'com.github.parse-community.Parse-SDK-Android:parse:1.18.5'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.0'
    compile 'org.testng:testng:6.10'
    compile 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    compile 'com.parse.bolts:bolts-tasks:1.3.0'
    compile 'com.jjoe64:graphview:4.2.2'
    compile 'com.android.support:cardview-v7:27.0.0'
    compile 'javax.mail:javax.mail-api:1.6.0'
    compile 'com.sun.mail:android-mail:1.6.0'
    compile 'com.sun.mail:android-activation:1.6.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    compile 'com.android.support:design:27.1.1'


    compile 'com.google.android.gms:play-services-ads:18.3.0'

    //testCompile 'org.testng:testng:6.10'
    compile files('C:/Users/xxx/AndroidStudioProjects/xxx/libs/activation.jar')
    compile files('C:/Users/xxx/AndroidStudioProjects/xxx/libs/additionnal.jar')
    compile files('C:/Users/xxx/AndroidStudioProjects/Bxx/libs/mail.jar')
    compile 'com.google.android.gms:play-services-appindexing:9.0.0'



}
但它不起作用。这是应用程序。gradle

compile 'com.google.android.gms:play-services-ads:18.3.0'
apply plugin: 'com.android.application'

android {

    configurations.all {
        resolutionStrategy.force 'junit:junit:4.12'


    }
    compileSdkVersion 27
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.xxx"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



dependencies {
    repositories {
        mavenCentral()
        jcenter()

        maven {
            url "https://jitpack.io"
        }
    }
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.parse:parse-android:1.14.1'
    compile 'com.github.parse-community.Parse-SDK-Android:parse:1.18.5'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.0'
    compile 'org.testng:testng:6.10'
    compile 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    compile 'com.parse.bolts:bolts-tasks:1.3.0'
    compile 'com.jjoe64:graphview:4.2.2'
    compile 'com.android.support:cardview-v7:27.0.0'
    compile 'javax.mail:javax.mail-api:1.6.0'
    compile 'com.sun.mail:android-mail:1.6.0'
    compile 'com.sun.mail:android-activation:1.6.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    compile 'com.android.support:design:27.1.1'


    compile 'com.google.android.gms:play-services-ads:18.3.0'

    //testCompile 'org.testng:testng:6.10'
    compile files('C:/Users/xxx/AndroidStudioProjects/xxx/libs/activation.jar')
    compile files('C:/Users/xxx/AndroidStudioProjects/xxx/libs/additionnal.jar')
    compile files('C:/Users/xxx/AndroidStudioProjects/Bxx/libs/mail.jar')
    compile 'com.google.android.gms:play-services-appindexing:9.0.0'



}
这是gradle项目:

buildscript {
    repositories {
        //mavenCentral()
        jcenter()


    }

    dependencies {

        //compile "com.github.parse-community.Parse-SDK-Android:parse:JitPack.1.19.0"
        classpath 'com.android.tools.build:gradle:2.2.1'
        classpath 'com.google.gms:google-services:4.1.0'





        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()

        maven {
            url "https://maven.google.com"
        }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
当我试图编译时,错误会立即将我发送到清单:

错误:(19)在包“android”中找不到属性“appComponentFactory”的资源标识符 错误:任务“:app:processDebugResources”的执行失败。 com.android.ide.common.process.ProcessException:未能执行aapt

这些在清单中是红色的,但不仅仅是:

android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:supportsRtl="true"
我试图改变谷歌服务的版本,应用程序索引的版本,添加的版本。我已经浏览了很多帖子,但似乎都不管用。要么SDK版本不一样,我试图将其降级到26,但android告诉我在目录中找不到26

有人能帮我吗


谢谢

通过安装firebase并调整版本解决了问题。

通过安装firebase并调整版本解决了问题