gpt4 book ai didi

android - Unity3D - 多个 dex 文件定义了为 android (Firebase) 构建时的异常

转载 作者:行者123 更新时间:2023-11-29 23:28:08 27 4
gpt4 key购买 nike

我们正在尝试将 Firebase Analytics 集成到我们的项目中。一旦我们添加了包,一堆播放服务解析器就会运行并删除一堆“过时”的东西。在此之后,我们无法将 Gradle 构建到 Android,因为多个 dex 文件显然定义了相同的东西。我们尝试删除任何重复的 .Jar、.aar 和 .Java 文件,但无济于事。老实说,我们不知道如何解决这个问题。它在一个新项目上构建得很好,所以我们的插件之间肯定存在一些冲突,但我不知道它可能是什么插件......

如果有人能为我们指明解决此问题的方向,我们将不胜感激...

兄弟们干杯。

CommandInvokationFailure: Gradle build failed. 
C:/Program Files/Java/jdk1.8.0_144\bin\java.exe -classpath "C:\Program Files\Unity201740f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 22s
]
stdout[
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Foxie-Dev02\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Foxie-Dev02\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Foxie-Dev02\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:prepareAndroidArchLifecycleRuntime100Library
:prepareAnimatedVectorDrawable2531Library
:prepareAppcompatV72531Library
:prepareCardviewV72531Library
:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:prepareComAndroidSupportAppcompatV72610Library
:prepareComAndroidSupportCardviewV72610Library
:prepareComAndroidSupportCustomtabs2610Library
:prepareComAndroidSupportSupportCompat2610Library
:prepareComAndroidSupportSupportCoreUi2610Library
:prepareComAndroidSupportSupportCoreUtils2610Library
:prepareComAndroidSupportSupportFragment2610Library
:prepareComAndroidSupportSupportMediaCompat2610Library
:prepareComAndroidSupportSupportV42610Library
:prepareComAndroidSupportSupportVectorDrawable2610Library
:prepareComGoogleAndroidGmsPlayServicesAdsIdentifier1600Library
:prepareComGoogleAndroidGmsPlayServicesBase1601Library
:prepareComGoogleAndroidGmsPlayServicesBasement1601Library
:prepareComGoogleAndroidGmsPlayServicesMeasurementApi1602Library
:prepareComGoogleAndroidGmsPlayServicesMeasurementBase1603Library
:prepareComGoogleAndroidGmsPlayServicesStats1601Library
:prepareComGoogleAndroidGmsPlayServicesTasks1601Library
:prepareComGoogleFirebaseFirebaseAnalytics1604Library
:prepareComGoogleFirebaseFirebaseAnalyticsImpl1622Library
:prepareComGoogleFirebaseFirebaseAnalyticsUnity540Library
:prepareComGoogleFirebaseFirebaseAppUnity540Library
:prepareComGoogleFirebaseFirebaseCommon1603Library
:prepareComGoogleFirebaseFirebaseCore1604Library
:prepareComGoogleFirebaseFirebaseIid1704Library
:prepareComGoogleFirebaseFirebaseIidInterop1601Library
:prepareComGoogleFirebaseFirebaseMeasurementConnector1701Library
:prepareComGoogleFirebaseFirebaseMeasurementConnectorImpl1702Library
:prepareCommonLibrary
:prepareCustomtabs2531Library
:prepareFacebookAndroidSdk4230Library
:prepareFacebookAndroidWrapper7100Library
:prepareGoogleAIDLLibrary
:prepareGooglePlayLibrary
:prepareShortcutBadger1121Library
:prepareSupportCompat2531Library
:prepareSupportCoreUi2531Library
:prepareSupportCoreUtils2531Library
:prepareSupportFragment2531Library
:prepareSupportMediaCompat2531Library
:prepareSupportV42531Library
:prepareSupportVectorDrawable2531Library
:prepareUtnotificationsLibrary
:Firebase:preBuild UP-TO-DATE
:Firebase:preReleaseBuild UP-TO-DATE
:Firebase:checkReleaseManifest
:Firebase:prepareReleaseDependencies
:Firebase:compileReleaseAidl
:Firebase:compileReleaseNdk NO-SOURCE
:Firebase:compileLint
:Firebase:copyReleaseLint NO-SOURCE
:Firebase:mergeReleaseShaders
:Firebase:compileReleaseShaders
:Firebase:generateReleaseAssets
:Firebase:mergeReleaseAssets
:Firebase:mergeReleaseProguardFiles
:Firebase:packageReleaseRenderscript NO-SOURCE
:Firebase:compileReleaseRenderscript
:Firebase:generateReleaseResValues
:Firebase:generateReleaseResources
:Firebase:packageReleaseResources
:Firebase:processReleaseManifest
:Firebase:generateReleaseBuildConfig
:Firebase:processReleaseResources
:Firebase:generateReleaseSources
:Firebase:incrementalReleaseJavaCompilationSafeguard
:Firebase:javaPreCompileRelease
:Firebase:compileReleaseJavaWithJavac
:Firebase:processReleaseJavaRes NO-SOURCE
:Firebase:transformResourcesWithMergeJavaResForRelease
:Firebase:transformClassesAndResourcesWithSyncLibJarsForRelease
:Firebase:mergeReleaseJniLibFolders
:Firebase:transformNativeLibsWithMergeJniLibsForRelease
:Firebase:transformNativeLibsWithSyncJniLibsForRelease
:Firebase:bundleRelease
:UTNotificationsRes:preBuild UP-TO-DATE
:UTNotificationsRes:preReleaseBuild UP-TO-DATE
:UTNotificationsRes:checkReleaseManifest
:UTNotificationsRes:prepareReleaseDependencies
:UTNotificationsRes:compileReleaseAidl
:UTNotificationsRes:compileReleaseNdk NO-SOURCE
:UTNotificationsRes:compileLint
:UTNotificationsRes:copyReleaseLint NO-SOURCE
:UTNotificationsRes:mergeReleaseShaders
:UTNotificationsRes:compileReleaseShaders
:UTNotificationsRes:generateReleaseAssets
:UTNotificationsRes:mergeReleaseAssets
:UTNotificationsRes:mergeReleaseProguardFiles
:UTNotificationsRes:packageReleaseRenderscript NO-SOURCE
:UTNotificationsRes:compileReleaseRenderscript
:UTNotificationsRes:generateReleaseResValues
:UTNotificationsRes:generateReleaseResources
:UTNotificationsRes:packageReleaseResources
:UTNotificationsRes:processReleaseManifest
:UTNotificationsRes:generateReleaseBuildConfig
:UTNotificationsRes:processReleaseResources
:UTNotificationsRes:generateReleaseSources
:UTNotificationsRes:incrementalReleaseJavaCompilationSafeguard
:UTNotificationsRes:javaPreCompileRelease
:UTNotificationsRes:compileReleaseJavaWithJavac
:UTNotificationsRes:processReleaseJavaRes NO-SOURCE
:UTNotificationsRes:transformResourcesWithMergeJavaResForRelease
:UTNotificationsRes:transformClassesAndResourcesWithSyncLibJarsForRelease
:UTNotificationsRes:mergeReleaseJniLibFolders
:UTNotificationsRes:transformNativeLibsWithMergeJniLibsForRelease
:UTNotificationsRes:transformNativeLibsWithSyncJniLibsForRelease
:UTNotificationsRes:bundleRelease
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:incrementalReleaseJavaCompilationSafeguard
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseNdk NO-SOURCE
:compileReleaseSources
:lintVitalRelease
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:transformClassesWithDexForRelease FAILED
110 actionable tasks: 110 executed
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

build.gradle(注意:在修复错误的过程中更改了以下代码。为了解决我们的问题,删除了某些依赖项)。

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}

allprojects {
repositories {
flatDir {
dirs 'libs'
}
}
}

apply plugin: 'com.android.application'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'android.arch.lifecycle.runtime-1.0.0', ext:'aar')
compile(name: 'com.android.support.animated-vector-drawable-26.1.0', ext:'aar')
compile(name: 'com.android.support.appcompat-v7-26.1.0', ext:'aar')
compile(name: 'com.android.support.cardview-v7-26.1.0', ext:'aar')
compile(name: 'com.android.support.customtabs-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-compat-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-core-ui-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-core-utils-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-fragment-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-media-compat-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-v4-26.1.0', ext:'aar')
compile(name: 'com.android.support.support-vector-drawable-26.1.0', ext:'aar')
compile(name: 'com.google.android.gms.play-services-ads-identifier-16.0.0', ext:'aar')
compile(name: 'com.google.android.gms.play-services-base-16.0.1', ext:'aar')
compile(name: 'com.google.android.gms.play-services-basement-16.0.1', ext:'aar')
compile(name: 'com.google.android.gms.play-services-measurement-api-16.0.2', ext:'aar')
compile(name: 'com.google.android.gms.play-services-measurement-base-16.0.3', ext:'aar')
compile(name: 'com.google.android.gms.play-services-stats-16.0.1', ext:'aar')
compile(name: 'com.google.android.gms.play-services-tasks-16.0.1', ext:'aar')
compile(name: 'com.google.firebase.firebase-analytics-16.0.4', ext:'aar')
compile(name: 'com.google.firebase.firebase-analytics-impl-16.2.2', ext:'aar')
compile(name: 'com.google.firebase.firebase-analytics-unity-5.4.0', ext:'aar')
compile(name: 'com.google.firebase.firebase-app-unity-5.4.0', ext:'aar')
compile(name: 'com.google.firebase.firebase-common-16.0.3', ext:'aar')
compile(name: 'com.google.firebase.firebase-core-16.0.4', ext:'aar')
compile(name: 'com.google.firebase.firebase-iid-17.0.4', ext:'aar')
compile(name: 'com.google.firebase.firebase-iid-interop-16.0.1', ext:'aar')
compile(name: 'com.google.firebase.firebase-measurement-connector-17.0.1', ext:'aar')
compile(name: 'com.google.firebase.firebase-measurement-connector-impl-17.0.2', ext:'aar')
compile(name: 'common', ext:'aar')
compile(name: 'customtabs-25.3.1', ext:'aar')
compile(name: 'facebook-android-sdk-4.23.0', ext:'aar')
compile(name: 'facebook-android-wrapper-7.10.0', ext:'aar')
compile(name: 'GoogleAIDL', ext:'aar')
compile(name: 'GooglePlay', ext:'aar')
compile(name: 'ShortcutBadger-1.1.21', ext:'aar')
compile(name: 'utnotifications', ext:'aar')
compile project(':Firebase')
compile project(':UTNotificationsRes')
}

android {
compileSdkVersion 28
buildToolsVersion '27.0.3'

defaultConfig {
targetSdkVersion 28
applicationId 'com.FoxieGames.WolfEvolution'
}

lintOptions {
abortOnError false
}

aaptOptions {
noCompress '.unity3d', '.ress', '.resource', '.obb','bin/data/02699eb9bf049e34598159ce0c81ab0f.resource','bin/data/08747c70106469044be87a8d49638bfd.resource','bin/data/087513eb2f44ea743aeacc30213c8e54.resource','bin/data/0f59709ea21789946b44eae3449dd2cf.resource','bin/data/12fef1f7c084d48409227f6f97183d68.resource','bin/data/1dfac539090e8e047804208581cb9b4a.resource','bin/data/2487cd62d993a6c408d6503c8a2ce659.resource','bin/data/2a1889f3a216a7846b140198c0dc6789.resource','bin/data/31c65f2a7d05ceb41bc749705cf0ac39.resource','bin/data/3f8667afc6eb3a34abd32d67a9be862d.resource','bin/data/461ab6af92be8be41bbb40c574863ab5.resource','bin/data/520314cd8ed60db4e8bc546698fbf49d.resource','bin/data/553b4b5b8a29d6143819a791e91bc9f4.resource','bin/data/55bc945adf097cc45a5675ca38f98637.resource','bin/data/69c1986c4f406f049914a0f0a67b11e7.resource','bin/data/6aebc8a7d3f190440b755fb3304d1b0e.resource','bin/data/6fd2fed6e57460d458f58b109f47be5f.resource','bin/data/8d08e130764187b41a241b8e63b450b3.resource','bin/data/922b6541a64ee4b40ab51555138f20a5.resource','bin/data/9e9e4236384f1cd42820f71e2c7e924d.resource','bin/data/a431a3cd6f471bc4eb32c1d1272c35b4.resource','bin/data/b6651b55bfa61d24fa857ddc20e4f1d7.resource','bin/data/b6d1c852ce9b65a4d955ce5505b3f6c0.resource','bin/data/b735612a2c95ec0469e1d40ef7b0b6f9.resource','bin/data/c864fb8ea19443a4a9738a389bd28a0a.resource','bin/data/c8ddb94b8baefbe4284af958325d02a5.resource','bin/data/caad8e9ba87307142b93f9fe6e0a2ef7.resource','bin/data/d78fe5dc8845f8d4d9e12f38c8c7fc75.resource','bin/data/e09fb570c3608074ba5c637de3b51f67.resource','bin/data/e7a18ee69637edb42b7938def055bd20.resource','bin/data/f27a19dea138ebc4ca4f19a6983fce87.resource','bin/data/f6a0424e3fb957e48887b89f2a9c97c0.resource','bin/data/f8fc0e1ee67ff07499cdbbbd47d18d98.resource','bin/data/sharedassets0.resource','bin/data/sharedassets1.resource'
}

signingConfigs { release {
storeFile file('C:/myprojects/keystores/keystore_wolfevolution.keystore')
storePassword 'teamfoxie'
keyAlias 'foxie games'
keyPassword 'teamfoxie'
} }

buildTypes {
debug {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
jniDebuggable true
}
release {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
signingConfig signingConfigs.release
}
}

}

最佳答案

更新

问题是两个版本不同的 appcompat 库。检查

许多图书馆都有重复。

删除它们并将所有版本从 25.3.1 更新到 26.1.0

关于android - Unity3D - 多个 dex 文件定义了为 android (Firebase) 构建时的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53149069/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com