一、
Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
Message{kind=ERROR, text=Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)}
解决方法:
二、
Gradle sync failed: Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
Consult IDE log for more details (Help | Show Log) (3m 14s 776ms)
解决方法:
step1:点击Project → gradle →gradle.properties,把gradle版本改成4.4,如下:
step2 :修改project的build.gradle文件中的gradle tool版本至3.1.2,如下:
step3:添加goolgle maven 仓库并同步项目,如下
点击上图中的 Add Google Maven repository and sync project
三、Caused by: java.lang.RuntimeException: Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version of Android Studio
原因:之前由于AS没有强制,一直沿用以前的NDK开发方法,在gradle.properties添加android.useDeprecatedNdk=true的属性。
可是AS3.0以后被强制必须使用Cmake编译了。
Cmake是AS在2.2中提出的更加方便的JNI开发的构建工具,相当于之前使用是NDK-BUILDE。
https://blog.csdn.net/u012761076/article/details/79064878
AndroidStudio用Cmake方式编译NDK代码
https://blog.csdn.net/joe544351900/article/details/53637549
临时解决方案:
gradle:3.1.2 studio3.1.2 注释掉android.useDeprecatedNdk=true注释掉,换成android.deprecatedNdkCompileLease=1511832698813可以,后面那一串数字转化为时间其实就是有效期限,自己可以延长
四、Process 'command 'D:\Android\sdk\ndk-bundle\ndk-build.cmd'' finished with non-zero exit value 2
解决方法:
1、编译NDK时最好不要使用SDKManager里下载的ndk-bundle,否则会报这些错误
2、官网下载NDK开发包,r10、r11系列,然后替换掉旧的ndk就可以了
五、编译时一直处在:Indexing paused due to batch updated
解决方法:
1、退出AS,去项目目录下删除项目module下所有的.impl文件,删除项目所有的.idea文件
2. 退出项目重新点击Open an existing Android Studio Project
这位文章写的不错:https://blog.csdn.net/qq_30379689/article/details/52089633