#firebase #unity3d #gradle
#firebase #unity-game-engine #gradle
Вопрос:
Перед добавлением хранилища Firebase в мой проект Unity я смог создать APK с помощью Firebase Auth, Analytics, Facebook SDK и пакета Google Play.
После того, как я добавил хранилище Firebase, я начал получать ошибку, подобную этой
com.android.builder.dexing.DexArchiveBuilderException: Failed to process
Я добавил multiDexEnabled true в свой пользовательский файл gradle, но все еще не смог его решить.
Полный журнал ошибок здесь:
CommandInvokationFailure: Gradle build failed.
G:Program Files2018.3.6f1EditorDataPlaybackEnginesAndroidPlayer/ToolsOpenJDKWindowsbinjava.exe -classpath "G:Program Files2018.3.6f1EditorDataPlaybackEnginesAndroidPlayerToolsgradlelibgradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
D8: Type com.google.android.gms.internal.base.zal is referenced as an interface from `com.google.android.gms.internal.base.zao`.
D8: Type com.google.android.gms.games.internal.zze$zzaw is referenced as an interface from `com.google.android.gms.games.internal.zzay`.
D8: Type com.google.android.gms.games.internal.zze$zzap is referenced as an interface from `com.google.android.gms.games.internal.zzat`.
D8: Type com.google.android.gms.measurement.internal.zzcv is referenced as an interface from `com.google.android.gms.measurement.internal.zzft`.
D8: Type com.google.android.gms.internal.measurement.zzq is referenced as an interface from `com.google.android.gms.internal.measurement.zzr`.
D8: Interface `com.google.android.gms.measurement.internal.zzcy(classpath class)` used as super class of `com.google.android.gms.measurement.module.Analytics$Param`.
D8: Interface `com.google.android.gms.measurement.internal.zzcx(classpath class)` used as super class of `com.google.android.gms.measurement.module.Analytics$Event`.
D8: Type com.google.android.gms.measurement.internal.zzs is referenced as an interface from `com.google.android.gms.measurement.internal.zzbq`.
D8: Type com.google.android.gms.measurement.internal.zzs is referenced as an interface from `com.google.android.gms.measurement.internal.zzr`.
D8: Type com.google.android.gms.measurement.internal.zzfc is referenced as an interface from `com.google.android.gms.measurement.AppMeasurementService`.
D8: Type com.google.firebase.auth.internal.zzx is referenced as an interface from `com.google.firebase.auth.internal.zzw`.
D8: Type com.google.android.gms.internal.firebase_messaging.zza is referenced as an interface from `com.google.android.gms.internal.firebase_messaging.zzd`.
com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-16.4.0.aarabb843582499a845bfba90f9a8cd6c7jarsclasses.jar
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:405)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-16.4.0.aarabb843582499a845bfba90f9a8cd6c7jarsclasses.jar
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:900)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda$convertToDexArchive$6(DexArchiveBuilderTransform.java:825)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
at com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:124)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:101)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:895)
... 6 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:65)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:43)
at com.android.tools.r8.D8.run(D8.java:90)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:99)
... 7 more
Caused by: com.android.tools.r8.utils.AbortException: Error: Type com.google.android.gms.measurement.internal.zzcv is referenced as an interface from `com.google.android.gms.measurement.internal.zzft`.
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:116)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:74)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:59)
... 10 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexBuilderForRelease'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-16.4.0.aarabb843582499a845bfba90f9a8cd6c7jarsclasses.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 33s
]
stdout[
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
:checkReleaseClasspath UP-TO-DATE
:preBuild UP-TO-DATE
:Firebase:preBuild UP-TO-DATE
:Firebase:preReleaseBuild UP-TO-DATE
:Firebase:checkReleaseManifest
:Firebase:processReleaseManifest
:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:checkReleaseManifest
:GooglePlayGamesManifest.plugin:processReleaseManifest
:preReleaseBuild UP-TO-DATE
:Firebase:compileReleaseAidl NO-SOURCE
:GooglePlayGamesManifest.plugin:compileReleaseAidl NO-SOURCE
:compileReleaseAidl NO-SOURCE
:Firebase:packageReleaseRenderscript NO-SOURCE
:GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
:compileReleaseRenderscript UP-TO-DATE
:checkReleaseManifest UP-TO-DATE
:generateReleaseBuildConfig UP-TO-DATE
:prepareLintJar UP-TO-DATE
:mainApkListPersistenceRelease UP-TO-DATE
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources UP-TO-DATE
:Firebase:compileReleaseRenderscript
:Firebase:generateReleaseResValues
:Firebase:generateReleaseResources
:Firebase:packageReleaseResources
:GooglePlayGamesManifest.plugin:compileReleaseRenderscript
:GooglePlayGamesManifest.plugin:generateReleaseResValues
:GooglePlayGamesManifest.plugin:generateReleaseResources
:GooglePlayGamesManifest.plugin:packageReleaseResources
:mergeReleaseResources UP-TO-DATE
:createReleaseCompatibleScreenManifests UP-TO-DATE
:processReleaseManifest
:splitsDiscoveryTaskRelease UP-TO-DATE
:Firebase:generateReleaseRFile
:GooglePlayGamesManifest.plugin:generateReleaseRFile
:processReleaseResources
:generateReleaseSources
:Firebase:generateReleaseBuildConfig
:Firebase:prepareLintJar UP-TO-DATE
:Firebase:generateReleaseSources
:Firebase:javaPreCompileRelease
:Firebase:compileReleaseJavaWithJavac
:Firebase:processReleaseJavaRes NO-SOURCE
:Firebase:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
:GooglePlayGamesManifest.plugin:prepareLintJar UP-TO-DATE
:GooglePlayGamesManifest.plugin:generateReleaseSources
:GooglePlayGamesManifest.plugin:javaPreCompileRelease
:GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
:GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
:GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
:javaPreCompileRelease UP-TO-DATE
:compileReleaseJavaWithJavac UP-TO-DATE
:compileReleaseNdk NO-SOURCE
:compileReleaseSources UP-TO-DATE
:lintVitalRelease
:mergeReleaseShaders UP-TO-DATE
:compileReleaseShaders UP-TO-DATE
:generateReleaseAssets UP-TO-DATE
:Firebase:mergeReleaseShaders
:Firebase:compileReleaseShaders
:Firebase:generateReleaseAssets
:Firebase:packageReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseShaders
:GooglePlayGamesManifest.plugin:compileReleaseShaders
:GooglePlayGamesManifest.plugin:generateReleaseAssets
:GooglePlayGamesManifest.plugin:packageReleaseAssets
:mergeReleaseAssets
:transformClassesWithDexBuilderForRelease
C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-base-16.3.0.aar702a0abeefe42af5bfc4765ad82de27ajarsclasses.jar: D8: Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.measurement.zzxj$zzb.zza(long, byte)`
C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-base-16.3.0.aar702a0abeefe42af5bfc4765ad82de27ajarsclasses.jar: D8: Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.measurement.zzxj$zza.zza(long, byte)`
C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-impl-16.4.0.aar46f7b46f1f1cb3cf2ce4f39251a03fc4jarsclasses.jar: D8: Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.measurement.zzhw$zzb.zza(long, byte)`
C:UsersMain.gradlecachestransforms-1files-1.1com.google.android.gms.play-services-measurement-impl-16.4.0.aar46f7b46f1f1cb3cf2ce4f39251a03fc4jarsclasses.jar: D8: Type `libcore.io.Memory` was not found, it is require<message truncated>
Ответ №1:
Исправлено, удаление и повторный импорт всех сервисов facebook, firebase и Google Play устранили проблему