I'm not able to build an android project with Unity when I have Admob with Vungle Mediation and Firebase Analytics imported in the same project.
Even though, it's all working fine if i build with juste admob and vungle mediation or admob without vungle mediation and firebase analytics.
1) If I do a gradle export, the export work fine but when I try to build the gradle project I get this error:
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_162\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2017.4.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
Dex: Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:781)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:747)
at com.android.dx.command.dexer.Main.access$1200(Main.java:88)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1689)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:695)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:592)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:321)
at com.android.dx.command.dexer.Main.run(Main.java:292)
at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)
at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:174)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:476)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:793)
at com.android.dx.command.dexer.Main.access$1600(Main.java:88)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1728)
at com.android.dx.command.dexer.Main.processClass(Main.java:779)
... 16 more
1 error; aborting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex 'C:\Users\Severin\.android\build-cache\65e4a76a40a2f384bbd98d8e48470d76f908c3db\output\jars\classes.jar' to 'C:\Users\Severin\Documents\UnityProjects\AdMob_VungleMediation_Firebase_Error\Temp\gradleOut\build\intermediates\pre-dexed\release\classes_ba1f2e537c2c30029726a3952c65b51203c6fdd5.jar'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 25s
]
stdout[
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
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.
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:prepareAndroidArchCoreRuntime110Library
:prepareAndroidArchLifecycleLivedataCore110Library
:prepareAndroidArchLifecycleRuntime110Library
:prepareAndroidArchLifecycleViewmodel110Library
:prepareComAndroidSupportAnimatedVectorDrawable2711Library
:prepareComAndroidSupportAppcompatV72711Library
:prepareComAndroidSupportCustomtabs2711Library
:prepareComAndroidSupportSupportCompat2711Library
:prepareComAndroidSupportSupportCoreUi2711Library
:prepareComAndroidSupportSupportCoreUtils2711Library
:prepareComAndroidSupportSupportFragment2711Library
:prepareComAndroidSupportSupportMediaCompat2711Library
:prepareComAndroidSupportSupportV42711Library
:prepareComAndroidSupportSupportVectorDrawable2711Library
:prepareComEvernoteAndroidJob120Library
:prepareComGithubVungleVungleAndroidSdk634Library
:prepareComGoogleAdsMediationVungle6250Library
:prepareComGoogleAndroidGmsPlayServicesAds1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsBase1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsIdentifier1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsLite1501Library
:prepareComGoogleAndroidGmsPlayServicesBase1501Library
:prepareComGoogleAndroidGmsPlayServicesBasement1501Library
:prepareComGoogleAndroidGmsPlayServicesGass1501Library
:prepareComGoogleAndroidGmsPlayServicesMeasurementBase1600Library
:prepareComGoogleAndroidGmsPlayServicesStats1501Library
:prepareComGoogleAndroidGmsPlayServicesTasks1501Library
:prepareComGoogleFirebaseFirebaseAnalytics1601Library
:prepareComGoogleFirebaseFirebaseAnalyticsImpl1611Library
:prepareComGoogleFirebaseFirebaseAnalyticsUnity511Library
:prepareComGoogleFirebaseFirebaseAppUnity511Library
:prepareComGoogleFirebaseFirebaseCommon1600Library
:prepareComGoogleFirebaseFirebaseCore1601Library
:prepareComGoogleFirebaseFirebaseIid1620Library
:prepareComGoogleFirebaseFirebaseIidInterop1600Library
:prepareComGoogleFirebaseFirebaseMeasurementConnector1700Library
:prepareComGoogleFirebaseFirebaseMeasurementConnectorImpl1601Library
:prepareComTonyodevFetchFetch115Library
:prepareNetVrallevAndroidCat105Library
: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:transformNativeLibsWithStripDebugSymbolForRelease
:Firebase:transformNativeLibsWithSyncJniLibsForRelease
:Firebase:bundleRelease
:GoogleMobileAdsPlugin:preBuild UP-TO-DATE
:GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE
:GoogleMobileAdsPlugin:checkReleaseManifest
:GoogleMobileAdsPlugin:prepareReleaseDependencies
:GoogleMobileAdsPlugin:compileReleaseAidl
:GoogleMobileAdsPlugin:compileReleaseNdk NO-SOURCE
:GoogleMobileAdsPlugin:compileLint
:GoogleMobileAdsPlugin:copyReleaseLint NO-SOURCE
:GoogleMobileAdsPlugin:mergeReleaseShaders
:GoogleMobileAdsPlugin:compileReleaseShaders
:GoogleMobileAdsPlugin:generateReleaseAssets
:GoogleMobileAdsPlugin:mergeReleaseAssets
:GoogleMobileAdsPlugin:mergeReleaseProguardFiles
:GoogleMobileAdsPlugin:packageReleaseRenderscript NO-SOURCE
:GoogleMobileAdsPlugin:compileReleaseRenderscript
:GoogleMobileAdsPlugin:generateReleaseResValues
:GoogleMobileAdsPlugin:generateReleaseResources
:GoogleMobileAdsPlugin:packageReleaseResources
:GoogleMobileAdsPlugin:processReleaseManifest
:GoogleMobileAdsPlugin:generateReleaseBuildConfig
:GoogleMobileAdsPlugin:processReleaseResources
:GoogleMobileAdsPlugin:generateReleaseSources
:GoogleMobileAdsPlugin:incrementalReleaseJavaCompilationSafeguard
:GoogleMobileAdsPlugin:javaPreCompileRelease
:GoogleMobileAdsPlugin:compileReleaseJavaWithJavac
:GoogleMobileAdsPlugin:processReleaseJavaRes NO-SOURCE
:GoogleMobileAdsPlugin:transformResourcesWithMergeJavaResForRelease
:GoogleMobileAdsPlugin:transformClassesAndResourcesWithSyncLibJarsForRelease
:GoogleMobileAdsPlugin:mergeReleaseJniLibFolders
:GoogleMobileAdsPlugin:transformNativeLibsWithMergeJniLibsForRelease
:GoogleMobileAdsPlugin:transformNativeLibsWithStripDebugSymbolForRelease
:GoogleMobileAdsPlugin:transformNativeLibsWithSyncJniLibsForRelease
:GoogleMobileAdsPlugin: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
104 actionable tasks: 104 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)