报错: The option setting ‘android.enableR8=false‘ is deprecated. It will be removed in version...

一、症状

从Unity3D中发布APK到android一体机(PICO G2 4K)时报错:
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

二、寻找药方

【Edit】【Project Settings】【Player】【Publishing Settings】【Build】
勾选两项:

  • Custom Launcher Manifest 勾选
  • Custom Launcher Gradle Template 勾选
    报错: The option setting ‘android.enableR8=false‘ is deprecated. It will be removed in version..._第1张图片
    参考了一个外国友人的帖子:
    https://answers.unity.com/questions/1846144/how-to-remove-androidenabler8-from-the-project.html

另外:如下所示,我勾选了【ARCore】,系统自动安装了一些包,并进行了一些初始化工作。
随后,我把上图中的两个Gradle选项取消勾选,也能发布成功。
报错: The option setting ‘android.enableR8=false‘ is deprecated. It will be removed in version..._第2张图片

你可能感兴趣的:(android,gradle,unity)