android studio 升级到最新版遇到的各种配置问题

android IED 从3.1.2 升级到最新 3.3

androidStudio 最新版

gradle 使用的最新版本 4.10.1

gradle的最新配置

ERROR: Could not set unknown property 'enforceUniquePackageName' for object of type 
com.android.build.gradle.LibraryExtension.
Open File
高版本不允许有 enforceUniquePackageName	
根据提示点击 Open File 注释掉  enforceUniquePackageName = false 
try again 然后
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see:
http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: xxxx,xxxxx【出问题的模块】
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: 
http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: xxxx,xxxxx【出问题的模块】
根据提示 2018 年后不允许使用 compile 和 androidTestCompile 替换相应引用方式 到对应的模块下将原有的 
compile --》 api,
androidTestCompile --》 androidTestImplementation
如果有多个请将多个替换。示例如下:
older
compile fileTree(include: '*.jar', dir: 'libs')
androidTestCompile('xxxxxx')
new
api fileTree(include: '*.jar', dir: 'libs')
androidTestImplementation('xxxxxx')

替换完成后 Sync Now 重新同步
大部分已经万事大吉,尽情使用最新环境撸代码。

猜你喜欢

转载自blog.csdn.net/ff_hh/article/details/88553583