Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.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.support.v4.os.ResultReceiver$MyResultReceiver_Android_Gradle - Fatal编程技术网

错误:程序类型已存在:android.support.v4.os.ResultReceiver$MyResultReceiver

错误:程序类型已存在:android.support.v4.os.ResultReceiver$MyResultReceiver,android,gradle,Android,Gradle,我已经尝试解决这个错误两天了,没有运气。我一直在到处搜索,大多数解决方案都告诉我从依赖项中删除“+”。但我已经没有任何“+”了。我使用的是绝对版本代码。在我集成Mikepenz的材料抽屉之前,该项目一直运作良好。材料抽屉在没有标题的情况下运行良好,当我添加标题时,会出现“ResourceNotFound”错误。为了解决这个问题,有些人说要更改“项目结构”中的“编译SDK版本”。当我把它改成“Android-P”时,我得到了上面提到的错误。当我将其设置为“27奥利奥”时,我得到另一个错误: And

我已经尝试解决这个错误两天了,没有运气。我一直在到处搜索,大多数解决方案都告诉我从依赖项中删除“+”。但我已经没有任何“+”了。我使用的是绝对版本代码。在我集成Mikepenz的材料抽屉之前,该项目一直运作良好。材料抽屉在没有标题的情况下运行良好,当我添加标题时,会出现“ResourceNotFound”错误。为了解决这个问题,有些人说要更改“项目结构”中的“编译SDK版本”。当我把它改成“Android-P”时,我得到了上面提到的错误。当我将其设置为“27奥利奥”时,我得到另一个错误:

Android resource linking failed
Output:  D:\SpesaBudgetManager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
D:\SpesaBudgetManager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
D:\SpesaBudgetManager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1207: error: resource android:attr/fontVariationSettings not found.
D:\SpesaBudgetManager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1207: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\Danis\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\c643f693a5e3c12b475023c52cd701d5\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
        C:\Users\Danis\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
        --manifest\
        D:\SpesaBudgetManager\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        D:\SpesaBudgetManager\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @D:\SpesaBudgetManager\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        D:\SpesaBudgetManager\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.spesa.spesabudgetmanager\
        -0\
        apk\
        --output-text-symbols\
        D:\SpesaBudgetManager\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
这是我的毕业证书:

apply plugin: 'com.android.application'

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

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.mikepenz:materialdrawer:6.0.9'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    implementation 'com.github.GrenderG:Toasty:1.3.0'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.airbnb.android:lottie:2.5.0'
    implementation 'com.github.yesterselga:country-picker-android:1.0'
    implementation 'com.github.midorikocak:currency-picker-android:1.1.9'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.google.firebase:firebase-storage:16.0.3'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.mikepenz:materialize:1.2.0@aar'
    implementation 'com.mikepenz:iconics-core:3.1.0@aar'
    implementation 'com.mikepenz:fastadapter:3.3.0@aar'
}

apply plugin: 'com.google.gms.google-services'

非常感谢您的帮助。

很可能一些LIB正在使用androidx

要找到哪一个,请运行

./gradlew tasks --all
找一条像这样的线

yourapp:dependencies
使用它来获取依赖关系树

./gradlew yourapp:dependencies 
我的依赖树的Pert

./gradlew yourapp:dependencies 


在我的例子中,是Advanced RecyclerView,在他们的页面上有这样一个通知“v1.0.0迁移到AndroidX(如果您的项目使用支持库,则使用v0.11.0)”,因此我遵循了建议,我的问题得到了解决。

尝试一下@AbdulmalekDery这样做会让情况变得更糟。Android说它无法解决AppCompat问题,我还收到了“Android资源链接失败”错误。很可能是
“mikepenz”
libs正在使用
androidx
。因此,您可以尝试在
gradle.properties
中添加
android.useAndroidX=true
android.enableJetifier=true
,我已经回答了这个问题: