Unity打Android包,报.gradle needs to be updated,old aaptOptions noCompress,需要更新unityStreamingAssets的错误

**

Unity打Android包,报*.gradle needs to be updated! old aaptOptionsnoCompress,关于unityStreamingAssets的错误mainTemplate.gradle needs to be updated!

**
we’ve detected that your custom
Assets/Plugins/Android 'mainTemplate.gradle file is using a deprecated way of controlling which tool shouldbe used to do the minification.To fix this, remove
“useProguard” entries yourself. We can also do this automatically, your current mainTemplate.gradle file will be backed up. Continue?
mainTemplate.gradle needs to be updated!
mainTemplate.gradle file is using the old aaptOptionsnoCompress property definitionError
mainTemplate.gradle file is using the old aaptOptionsnoCompress property definition which does not indludetypes defined by unityStreamingAssets constant.

提示mainTemplate.gradle需要更新。这里我们把Assets/Plugins/Android 'mainTemplate.gradle

    aaptOptions {
       	noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

修改为

    aaptOptions {
        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

launcherTemplate.gradle如果也报错,可以同样将里面的

noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]

替换为

noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')

重新打包即可。

猜你喜欢

转载自blog.csdn.net/gaoliang0/article/details/122052402