- 与现有库冲突
Unable to resolve dependency for ':app@devDebug/compileClasspath':
Could not resolve com.android.support:support-v4:18.+.
解决: 给现有库添加
exclude module: 'support-v4'
exclude group: 'com.android.support'
样例:
implementation('cn.leancloud.android:avoscloud-push:v4.6.4@aar') {
transitive = true
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
- Androidx与现有support引用了类似库的不同版本
Duplicate class android.support.v4.app.
INotificationSideChannel found in modules
core-1.1.0-runtime.jar (androidx.core:core:1.1.0)
and
support-compat-28.0.0-runtime.jar (com.android.support:support-compat:28.0.0)
解决:使用 --no-androidx 创建support版本的flutter module
flutter create -t module --no-androidx flutter_godlike
重点 flutter1.17.0以上版本使用--no-androidx创建出的module依然使用了androidx,需要降级到flutter1.12.13版本使用此命令
网友评论