将 Pushe unity 插件添加到我的 android 应用程序时出错

Error in adding Pushe unity plugin to my android app

当我想将 pushe unity 插件添加到我的应用程序时,我看到了以下错误。

有人知道出了什么问题吗?

Failed to compile resources with the following parameters:  
-bootclasspath ".../UNITY/android-sdk\platforms\android-21\android.jar" -d
"..\unity-sample-master\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8
"co\ronash\pushe\Manifest.java"
"co\ronash\pushe\R.java"
"com\google \android\gms\Manifest.java"
"com\google\android\gms\R.java"
"com\google\android\gms \base\Manifest.java"
"com\google\android\gms\base\R.java"
warning: [options] source value 1.6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

3 warnings
UnityEditor.HostView:OnGUI()

看来你的unity正在使用java 1.6来编译你的项目。

根据我的经验,unity 5 需要 java 1.8 或更高。这适用于使用最新版本的 unity 构建的最新 unity 插件,包括 Pushe plugin.

因此请尝试将您的 unity 使用的 java 版本更改为 1.8 或更高版本,路径如下:

Edit -> Preferences -> External tools

希望对您有所帮助。

我也运行关注这个问题。我尝试了 "changing the java version which unity uses to 1.8" 作为先前答案的建议,但在外部工具菜单中找不到任何选项。我还尝试弄清楚如何附加错误涌出中建议的“-Xlint:-options”参数,但找不到正确的位置来设置它,这似乎是一个 hack 开始。

我找到的唯一解决方案是从 JDK 9 降级到 JDK 8。您还需要通过编辑 -> 首选项 -> 外部工具更新 Unity 中的 JDK 路径。

我的 JDK 路径更改自:

/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

收件人:

/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home