1.Android sdk升级到28之后,找不到:
android.support.v7.app.NotificationCompat;
Android 8.0 以后v7包NotificationCompat类的扩展从包移到了v4包。
compileSdkVersion 26 的时候 v7包的NotificationCompat类被置为过时,
compileSdkVersion 27 的时候 v7包的NotificationCompat类被彻底移除。
此时只要改为引用v4包的NotificationCompat 类即可。
2.导入包之后报错:
implementation 'org.apache.commons:commons-compress:1.18'
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
解决方式:1.利用插件:https://github.com/singwhatiwanna/dynamic-load-apk