当前位置:   article > 正文

Error from android_androidstudio you cannot create an instance from t

androidstudio you cannot create an instance from the abstract interface 'org

项目切换出现问题

前因:

从在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{  //配置资源来源

  1. flatDir {
  2. dirs 'libs','../引入aar的module_name/libs'
  3. }...

clear cache and restart.

打包问题:

前因:引入第三方aar,build apk

出现:build fail:Please correct the above warnings first.

  1. Execution failed for task ':demo:transformClassesAndResourcesWithProguardForNormalRelease'.
  2. ...
  3. RuntimeException: java.io.IOException: Please correct the above warnings first.
  4. ...
  5. ...
  6. IOException: Please correct the above warnings first.
  7. at proguard.Initializer.execute(Initializer.java:485)
  8. 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改名给当前项目使用

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/317490?site
推荐阅读
相关标签
  

闽ICP备14008679号