java-无法编译为android(Unity)

java-无法编译为android(Unity),第1张

概述我正在尝试将我的VR项目编译为Android手机.但是我一直收到以下错误:Failedtocompileresourceswiththefollowingparameters:-bootclasspath"C:/ProgramFiles(x86)/Android/android-sdk\platforms\android-26\android.jar"-d"C:\Users\**\Documents\**\**\Temp\S

我正在尝试将我的VR项目编译为Android手机.

但是我一直收到以下错误:

Failed to compile resources with the following parameters:-bootclasspath "C:/Program files (x86)/AndroID/androID-sdk\platforms\androID-26\androID.jar" -d "C:\Users\**\documents\**\**\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -enCoding UTF-8 "com\Google\gvr\keyboardsupport\R.java" "com\Google\gvr\permissionsupport\R.java" "com\Google\vr\cardboard\R.java" "com\Google\vr\keyboard\R.java" "com\***\**\R.java" "com\unity3d\unitygvr\R.java"warning: [options] source value 1.6 is obsolete and will be removed in a future releasewarning: [options] target value 1.6 is obsolete and will be removed in a future releasewarning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

我已经安装了AndroID Studio& AndroID SDK我也安装了最新版本的Java SDK

谁能告诉我我能做什么?

更多错误:

    UnityException: Resource compilation Failed!Failed to recompile androID resource files. See the Console for details.UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuild (System.String Title, System.String message, System.Exception ex)UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuild (System.String Title, System.String message)UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String Title, System.String message)UnityEditor.AndroID.PostProcessor.Tasks.buildresources.CompileResources (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)UnityEditor.AndroID.PostProcessor.Tasks.buildresources.Execute (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)UnityEditor.AndroID.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)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.buildreporting.buildreport report)UnityEditor.AndroID.AndroIDBuildPostprocessor.PostProcess (BuildPostProcessArgs args)UnityEditor.PostprocessBuildplayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyname, System.String productname, Int32 wIDth, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.buildreporting.buildreport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildplayer.cs:263)UnityEditor.HostVIEw:OnGUI()
    UnityException: Resource compilation Failed!Failed to recompile androID resource files. See the Console for details.UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuild (System.String Title, System.String message, System.Exception ex)UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuild (System.String Title, System.String message)UnityEditor.AndroID.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String Title, System.String message)UnityEditor.AndroID.PostProcessor.Tasks.buildresources.CompileResources (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)UnityEditor.AndroID.PostProcessor.Tasks.buildresources.Execute (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)UnityEditor.AndroID.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.AndroID.PostProcessor.PostProcessorContext context)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.buildreporting.buildreport report)UnityEditor.AndroID.AndroIDBuildPostprocessor.PostProcess (BuildPostProcessArgs args)UnityEditor.PostprocessBuildplayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyname, System.String productname, Int32 wIDth, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.buildreporting.buildreport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildplayer.cs:263)UnityEditor.HostVIEw:OnGUI()

解决方法:

我认为这是由JDK 9引起的.我在装有JDK 9的家用计算机上看到相同的错误,在使用JDK 8的工作中看不到该错误.(具体来说,我有使用JDK 8 Update 131(64位)进行此 *** 作.)

如果我正确阅读了错误消息,则看起来好像是unity或androID工具链中的某件事正在请求针对Java 6.0(1.6)编译源文件.那已经有11年的历史了,因此在JDK 9中被标记为不推荐使用.降级到JDK 8应该可以解决它.最终,该工具链将需要更新以支持较新的版本.

总结

以上是内存溢出为你收集整理的java-无法编译为android(Unity)全部内容,希望文章能够帮你解决java-无法编译为android(Unity)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1091686.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存