more than one file was found with os independent path androidsupportmultidexversion.txt
因为项目新引入的类库里面有androidx.multidex:multidex:2.0.0包和项目中 com.android.support:multidex:1.0.3冲突。
在网上翻来翻去,说是在manifest文件中application节点下添加
tools:replace="android:appComponentFactory"
android:appComponentFactory="any string"这两句
又有了新的错误,多处重复包体版本错误。说是在gradle.properties文件整天价这两句话
android.enableR8.libraries=false
android.enableR8=false
android.useAndroidX=true
android.enableJetifier=true
最后还是各种报错,提示androidx库与现有的冲突。
使用命令:gradlew :app:dependencies 查看哪些包冲突
其实这个是因为androidx与android support库不能兼容导致的问题。
最后的解决方案就是https://www.jianshu.com/p/f7a7a8765294?tdsourcetag=s_pctim_aiomsg ,将项目构建成androidx库兼容。
把兼容的文件改完,以为一切搞定。结果,又报错Invoke customs are only supported starting with 0 --min api 26,这个就在app的build.gradle文件中android下面添加
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
android 引入其他类库导致的各种坑
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- AndroidX是Google 2018 IO 大会推出的新扩展库,主要是对Android 支持库做了重大改进。与...
- 在之前的开发经历中经常需要导入一些如v4、v7、v13等Android官方的支持包,遇到这些情况时都是网上搜索一下...
- 本文介绍了58同城迁移到AndroidX实践过程及对Jetifier源码分析。 《春宵》春宵一刻值千金,花有清香月...