赞
踩
项目切换出现问题:
前因:
从在androidx并且gradle版本为5.5的项目环境下,打开gradle 4.4,为升级androidx的项目B。
后果:
Could not load class 'org.jetbrains.kotlin.noarg.ide.NoArgModelImpl'
You cannot create an instance from the abstract class 'java.time.Clock' (code in build.gradle)
多次clean、rebuild Project,invilidate cache and restart 无效。
解决过程:
- 打开另一个未升级且gradle为4.4的项目C,能build finish;
- 复制gradle location,并restart.则解决问题
module使用问题:
前因:
module引入aar使用
后果:
能build sync success.but build and run error
module Could not find : xxxx.aar
... location:
项目目录/app/libs/..
项目目录/其他module/libs/..
(在这里地方找不到那个aar)
我以为是当前导入不成功,多次clean and build.(有stackFlow建议这个方法,但此处无效)
以为是网络不好,maven通道无法拉取,多次更换位置尝试
解决过程:
在build.gradle(project)
allprojects{
repositories{ //配置资源来源
- flatDir {
- dirs 'libs','../引入aar的module_name/libs'
- }...
clear cache and restart.
打包问题:
前因:引入第三方aar,build apk
出现:build fail:Please correct the above warnings first.
- Execution failed for task ':demo:transformClassesAndResourcesWithProguardForNormalRelease'.
- ...
- RuntimeException: java.io.IOException: Please correct the above warnings first.
- ...
- ...
- IOException: Please correct the above warnings first.
- at proguard.Initializer.execute(Initializer.java:485)
- at proguard.ProGuard.initialize(ProGuard.java:271)
解决:
可知与混淆有关,打开proguard-rules.pro,添加
-ignorewarnings
gradle build sync failed , but rebuild project successful:
报错:
app 带红叉,illegal char in ..... xxx .iml(projectName.iml)
解决:
打开其他能正常使用的项目,将projectName.iml改名给当前项目使用
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。