Error from android

项目切换出现问题

前因:

从在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改名给当前项目使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值