首页 > 解决方案 > 原因:重复条目:com/google/vr/cardboard/AndroidNCompat.class

问题描述

我正在我的项目中使用Unity创建一个应用程序。Cleaning该项目运行良好,但是当我单击Build APK时,它给了我以下错误:

原因:重复条目:com/google/vr/cardboard/AndroidNCompat.class

我的 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.package_name"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 3
        versionName "1.02"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }
}
buildscript {
    repositories {

        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.+'

    }
}

apply plugin: 'io.fabric'

/*
repositories {
    maven { url 'https://maven.fabric.io/public' }
}
*/

dependencies {
   compile project(path: ':DummyPackageName')
    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.squareup.retrofit:retrofit:2.0.0-beta2'
    compile 'com.android.support:multidex:1.0.1'
   compile(name: 'AVProVideoLibrary-arm7', ext: 'aar')
    compile(name: 'gvr', ext: 'aar')
    compile(name: 'gvr_android_common', ext: 'aar')
    compile(name: 'unitygvr', ext: 'aar')
    compile(name: 'unitygvractivity', ext: 'aar')
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
    compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    //    compile 'com.android.support:palette-v7:25.2.0'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile 'de.greenrobot:greendao-generator:2.1.0'
    compile 'de.greenrobot:greendao:2.1.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'
    compile 'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile 'com.google.android.gms:play-services-gcm:9.2.0'
    compile 'com.microsoft.azure:azure-mobile-android:3.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

  /*  compile 'com.google.vr:sdk-audio:1.80.0'

    // Required for all Google VR apps
    compile 'com.google.vr:sdk-base:1.80.0'*/

}
apply plugin: 'com.google.gms.google-services'
allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}

我进行了很多搜索,但没有找到任何解决方案。任何帮助或线索将不胜感激。谢谢!

标签: androidunity3d

解决方案


删除libprotobuf.jar对我有用。

在此处输入图像描述

Github 链接:https ://github.com/googlevr/gvr-unity-sdk/issues/325


推荐阅读