Unity problems with port to android [duplicate] - c#

This question already has an answer here:
Unable to list target platforms. Please make sure the android sdk path is correct
(1 answer)
Closed 5 years ago.
Can somebody help mi solve these problems
List of erros:
UnityException: Build failure!
Unable to locate Android SDK.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, UnityEditor.Android.CommandInvokationFailure ex)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (BuildOptions options, BuildTargetGroup targetGroup, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:97)
UnityEditor.HostView:OnGUI()
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/karik/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\1.Programy\5.Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/karik/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\1.Programy\5.Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
SDK path: C:\Users\karik\AppData\Local\Android\sdk
JDK path: C:\Program Files\Java\jdk1.8.0_131

Okay so the issue seems to be that the SDK updates deprecated a command line tool that Unity's build process uses. This was evident from the forum post Here
Rename your tools folder in the SDK to some arbitrary name.
Download the downgraded tools and extract them to the SDK root folder.
See if your issue is resolved!
If that does not work, try downgrading to the next lower version of SDK tools from the SDK manager.

Related

Unity Can not build when adding Ads

I have a problem for a few days that I can't solve.
When I add to my project(that work fine) a unity ads or admob using google package.
After I add one of this package and try to build my project for android I get an error with my gradle:
Exception: Gradle install not valid
Unity.Android.Gradle.AndroidGradle..ctor (System.String gradleLauncherPath, System.Int32
jvmHeapSize) (at <aa400196d78d4a0aab4d78eb144a59f3>:0)
UnityEditor.Android.GradleWrapper.CreateGradleInstance () (at
<62de111f18d242d586f9a078a33b1ba2>:0)
UnityEditor.Android.PostProcessAndroidPlayer.ExecuteWarmup (System.String stagingArea)
(at <62de111f18d242d586f9a078a33b1ba2>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess
(UnityEditor.Modules.BuildPostProcessArgs args,
AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at
<62de111f18d242d586f9a078a33b1ba2>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess
(UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties&
outProperties) (at <62de111f18d242d586f9a078a33b1ba2>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup
targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String
installPath, System.String companyName, System.String productName, System.Int32 width,
System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry
usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at
<11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I tried to download a gradle and replace it in my project but this dont solve it.
I tried copy the gradle location on the external tools and uncheck and copy the location and this not work.
I even try to open a new project using the monitaztion sample of unity and still get the same error.
Thank you.
I was with version 2021.3.16, and I try to install another version(2021.3.13) and now its work.
I Saw that the gradle is inside the unity folder so I thought that if I reinstall the unity or install another veraion it should fix it, or maybe its a bug in veraion 2021.3.16.

How to fix ''Gradle Build Failed'' on Unity?

I'm trying to build my android app for a while and can't seem to find any solution for this problem:
Image
Unity Version: Unity 2020.3.21f1 (64-bit)
JDK, SDK, NDK and Gradle used are Unity's recommended ones (already tried to use other ones).
The console details are here:
Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)`
FAILURE: Build failed with an exception.
* What went wrong:
com/sun/istack/FinalArrayList
* 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.
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2020.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
Build completed with a result of 'Failed' in 60 seconds (59527 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <208f92fc783546f9abbe643bfc23920c>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <208f92fc783546f9abbe643bfc23920c>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I already tried all tutorials on youtube and other forums, but every help is welcome, thanks!
Edit 1:
After trying Jaimin's solution this is happening now:
Assets/Plugins/Android\gradleTemplate.properties file is using a deprecated way of controlling which tool should be used to do the minification. To fix this, remove "useProguard" entries yourself. If not fixed, your build can fail.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
File C:\Users\Windows\.android\repositories.cfg could not be loaded.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
FAILURE: Build failed with an exception.
* What went wrong:
com/sun/istack/FinalArrayList
> com.sun.istack.FinalArrayList
* 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 5s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2020.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
com/sun/istack/FinalArrayList
> com.sun.istack.FinalArrayList
* 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 5s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <f94168442e634613b6a5965ed17c38f4>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f94168442e634613b6a5965ed17c38f4>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <f94168442e634613b6a5965ed17c38f4>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <208f92fc783546f9abbe643bfc23920c>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Build completed with a result of 'Failed' in 127 seconds (127448 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 5 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <208f92fc783546f9abbe643bfc23920c>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <208f92fc783546f9abbe643bfc23920c>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
And here's how the Custom Gradle Properties Template file is coded:
org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
org.gradle.parallel=true
unityStreamingAssets=.unity3d**STREAMING_ASSETS**
**ADDITIONAL_PROPERTIES**
This is because android.enableR8 is deprecated. To remove it from your gradle.properties file you have to go to Project Settings > Player > Android (Tab) > Other Settings > and check Custom Gradle Properties Template.
After that, a gradleTemplate.properties file is generated at:
Assets/Plugins/Android/gradleTemplate.properties
In this file, remove line android.enableR8, or comment it out, and now make new fresh build.
This trick should work.
Alternatively, export as an Android project and then change it in Android Studio. In Android Studio, you have more control on these things.
Install a new version of Unity, it will work
You can use the Unity 2020.3.33f1 version, that's the one I use, and it works fine.
Remember to set to Preferences: Unity default JDK, Gradle, NDK
I have seen in a lot of places and the issue is really painfull. In my case, my problem it was that there was an old CSharp interface of mine incorrect that wasn't in my csproj, so I couldn't see in my Visual Studio.
As Unity doesn't care about csproj, it uses it in compilation. I just noticed because of an inexistent java issue shown in Console window (because of Android, the CSharp was converted to Java and for this reason Graddle threw the issue).
Try to find in your CSharp program some class that doesn't appear in Solution Explorer in Visual Studio and remove or fix it.
Also, I followed the fix indicated above by Jaimin. It didn't work for me, but I left like that. It makes way more sense with it.
Try This
For Windows
go to the location
"C:\Program Files\Unity\Hub\Editor\2021.1.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\31.0.0"
find a file named d8.bat. This is a Windows batch file.
rename d8.bat to dx.bat.
in the folder lib ("C:\ProgramFiles\Unity\Hub\Editor\2021.1.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\31.0.0\lib")
rename d8.jar to dx.jar
Remember AppData is a hidden folder. Turn on hidden items to see the AppData folder.
Now run your project...
From ELNexs
https://forum.unity.com/threads/gradle-error-problem-with-gradle-build.538320/

CommandInvokationFailure: Gradle build failed (Same error again and again)

Unity version = Unity 2018.2.10f1
JDK = jdk1.8.0_191
PROBLEM:
CommandInvokationFailure: Gradle build failed. C:/Program
Files/Java/jdk1.8.0_191\bin\java.exe -classpath "C:\Program
Files\Unity\Hub\Editor\2018.3.0f2\Editor\2018.2.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar"
org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m"
"assembleRelease"
stderr[
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'gradleOut'.
Could not resolve all files for configuration ':classpath'.
Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar
Could not find ddmlib.jar (com.android.tools.ddms:ddmlib:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.1/ddmlib-26.0.1.jar
Could not find dvlib.jar (com.android.tools:dvlib:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/dvlib/26.0.1/dvlib-26.0.1.jar
Could not find common.jar (com.android.tools:common:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/common/26.0.1/common-26.0.1.jar
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 1s ] stdout[
] 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.Action1
progress, System.String error) UnityEditor.Android.GradleWrapper.Run
(UnityEditor.Android.AndroidJavaTools javaTools, System.String
workingdir, System.String task, System.Action1 progress) Rethrow as
GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run
(UnityEditor.Android.AndroidJavaTools javaTools, 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)
1)I have tried Changing the manifest for target sdk ...
2)clearing the gradle folder in user..
3)downgraded some sdk
Still can't build ...same error again and again.
Just upgrading it to Unity 2018.3.0f2 solved my problem
May be late, but I've fixed that issue by deleting the playcore.arr file from Assets/GooglePlayPlugins/com.google.play.core/Runtime/Plugins

Agora unity 2018 build issue for Android

When i build an agora apk
I got this
CommandInvokationFailure: Gradle build failed.
F:\Unity_2018.3.f1\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "F:\Unity_2018.3.f1\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\UNI\Downloads\AMG_FULL_Unity_v2_2_3_20\AMG_FULL_Unity\samples\Hello-Video-Unity-Agora\Temp\gradleOut\build.gradle' line: 17
What went wrong:
A problem occurred evaluating root project 'gradleOut'.
Failed to apply plugin [id 'com.android.application']
Gradle version 2.10 is required. Current version is 4.6. If using the gradle wrapper, try editing the distributionUrl in C:\Users\UNI\Downloads\AMG_FULL_Unity_v2_2_3_20\AMG_FULL_Unity\samples\Hello-Video-Unity-Agora\Temp\gradleOut\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
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 29s
]
stdout[
]
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.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, 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)
Cause of issue: If you are using an older version of the plugin (current version 2.4), there is an issue with the Gradle file that was included (was meant for older versions of Unity). Newer versions of Unity ship with a new version of Gradle which is causing the compile errors where Unity throws an error “Unable to build gradle”.
To resolve: Open your file explorer and navigate into the project Assets > Plugins > Android and delete the mainTemplate.gradle file.

Failed to re-package resources

i tried to add Ads to my mobile game and then i was going to test it on the phone and suddenly this came up. Yesterday it was all working fine. Does somebody know what those errors mean?
UnityException: Resource compilation failed! Failed to recompile
android resource files. See the Console for details.
UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow
(System.String title, System.String message, System.Exception ex)
UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow
(System.String title, System.String message)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources
(System.String stagingArea, System.String packageName,
UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal
(System.String stagingAreaData, System.String stagingArea,
System.String playerPackage, System.String installPath, System.String
companyName, System.String productName, BuildOptions options,
UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget
target, System.String stagingAreaData, System.String stagingArea,
System.String playerPackage, System.String installPath, System.String
companyName, System.String productName, BuildOptions options,
UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess
(BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target,
System.String installPath, System.String companyName, System.String
productName, Int32 width, Int32 height, System.String
downloadWebplayerUrl, System.String manualDownloadWebplayerUrl,
BuildOptions options, UnityEditor.RuntimeClassRegistry
usedClassRegistry) (at
and this one
Failed to compile resources with the following parameters:
-bootclasspath "C:/Users/Richard/Desktop/android-sdk-windows\platforms\android-24\android.jar"
-d "C:\Users\Richard\Desktop\BMP Jumper\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\MobileTest\Test\R.java" "com\unity3d\ads\android\R.java" warning:
C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported
by this compiler. It is recommended that the compiler be upgraded.
warning:
C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/AutoCloseable.class):
major version 52 is newer than 51, the highest major version supported
by this compiler. It is recommended that the compiler be upgraded. 2
warnings
ailed to compile resources with the following parameters:
-bootclasspath "C:/Users/Richard/Desktop/android-sdk-windows\platforms\android-24\android.jar"
-d "C:\Users\Richard\Desktop\BMP Jumper\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\MobileTest\Test\R.java" "com\unity3d\ads\android\R.java" warning:
C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported
by this compiler. It is recommended that the compiler be upgraded.
warning:
C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/AutoCloseable.class):
major version 52 is newer than 51, the highest major version supported
by this compiler. It is recommended that the compiler be upgraded. 2
warnings
I see that this is repeated many times in the error message: "major version 52 is newer than 51, the highest major version supported by this compiler." So I'd recommend you to uninstall Android API 24 (that is Nougat) from your PC using SDK manager. Also are you using the newest Unity 5.4?
major version 52 is newer than 51, the highest major version
supported by this compiler. It is recommended that the compiler be
upgraded. 2 warnings
This means that the Java environment you currently have cannot process the Java classes in your project, since they were compiled using a higher version compiler.
In simpler terms - a class with version 52.0 was compiled with a Java 8 compiler, but your local JDK is probably of a lower version.
The simplest fix is to install JDK 8 and then set Unity to use it (Preferences -> External Toolls).
If this still does not work, you can also check out this service for fixing Android specific build issues with Unity (DISCLAIMER: the service is provided by me)

Categories

Resources