原因:重复输入:com / google / vr / cardboard / AndroidNCompat.class

时间:2018-05-22 11:49:01

标签: android unity3d

我正在项目中使用 Unity 创建应用程序。 Cleaning该项目工作正常,但当我点击构建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'
        }
    }
}

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

1 个答案:

答案 0 :(得分:1)

删除 libprotobuf.jar 为我工作。

enter image description here

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