1.升级到Android Sutido 3.x后,跑测之前的Model的main()方法方法时报错:
1 | Could not resolve all files for configuration ':app:lintClassPath'. |
Error:Gradle: A problem occurred configuring root project ‘MyApplication’.
Could not resolve all files for configuration ‘:classpath’.
Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
project :
解决:
修改Project的build.gradle(注意:不是App的build.gradle),两处加上google()
1 | buildscript { |
2.
1 | E:\forDHQ\myapp\android\app\build\intermediates\res\merged\release\drawable-hdpi-v4\node_modules_reactnavigation_src_views_assets_backicon.png: error: Duplicate file. |
原因:旧版本的打包方式是把资源放在了$(rn_project)\ android \ app \ src \ main \ res下,新版的打包方式是在编译的$(rn_project)\android\app\build\intermediates\res\merged$(buildType)下,所以会造成重复文件的问题,导致导致任务“processReleaseResources”失败
解决:方法是把$(rn_project)\android\app\src\main\res文件夹下的带有drawable-xxxx的文件夹删掉就可以了
3.
1 | error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. |
解决办法:在你android文件夹gradle.properties文件里加上这句话:android.enableAapt2=false