1.apt不支持了
apply plugin: 'android-apt' 去掉
将apt改成annotationProcessor
例如:
改成apt 'com.google.dagger:dagger-compiler:2.0.2' compile 'com.google.dagger:dagger:2.0.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
compile 'com.google.dagger:dagger:2.0.2'
2.原生支持java1.8了
apply plugin: 'me.tatarka.retrolambda'干掉.原生支持lambda了
3.报错
Error:Execution failed for task ':app:compileDebugNdk'. > Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version of Android Studio. Please switch to a supported build system. Consider using CMake or ndk-build integration. For more information, go to:
android.useDeprecatedNdk=true这句话注释掉,不支持了
用cmakelist打包.so文件
怎么使用?这里直接去看人的吧 http://blog.csdn.net/cuiyufeng2/article/details/64125594但是你可以会遇到如下错误More than one file was found with OS independent path 'lib/armeabi/libserial_port.so'把jni.srcDirs = ['src/main/jni', 'src/main/jni/']改成jniLibs.srcDirs = [] clean一下重新编译就好了;More than one file was found with OS independent path 'lib/armeabi/libserial_port.so'
该错误的原因是有重复文件了,如果是cmake生成的.so就不要放在libs下面了,cmake里配置了就好,系统会自己找
如果还不行去掉这句话试试jniLibs.srcDirs = ['libs']
4.还是报错Error:(101, 5) error: style attribute '@android:attr/windowExitAnimation' not found.gradle.properties里面加入android.enableAapt2=false 就好了,这个也是网上搜的解决了以上问题,只记得这么四个了,记录下来