记录:升级android studio,项目编译没问题,运行报错,找不到文件

升级android studio到3.4.1,Sdk Build-Tools 到29,项目编译没有问题,但是运行报错,报错信息:

Android resource linking failed
error: resource andorid:style/Theme.AppCompat.Light.DarkActionBar not found. 
error: resource andorid:style/ThemeOverlay.AppCompat.Dark.ActionBar not found.
error: resource andorid:style/ThemeOverlay.AppCompat.Light not found. 
error: resource andorid:style/Theme.AppCompat.Light.Dialog.Alert not found.
error: failed linking references.

查找解决办法,以下都没有生效:

  1. Build-->Clean Project 
  2. Build-->Rebuild Project
  3. 重新同步Gradle
  4. 清空Android Studio缓存    "File"---->"Invalidated cache"---->"Invalidate and Restart"
  5. 升级SDK Manager
  6. 添加AppCompat依赖
    dependencies {
         implementation 'com.android.support:appcompat-v7:28.0.0'
    }
    

    (注:我这里其实之前就已经有添加了,所以这个不适用,不过好像有人因为之前没有添加,添加后就好了)

  7. 先移除对V7包的依赖,同步后再重新添加依赖(移除implementation 'com.android.support:appcompat-v7:x.x.x' ,然后同步后在添加回来)。此方法原文链接:https://blog.csdn.net/lkjfyy/article/details/87890675

以上都没有生效后,发现一篇文章(https://blog.csdn.net/hnjcxy/article/details/53084083),看到里面这句话:SDK更新之后,主题的目录可能在新版本里面有变化,所以出现了找不到的问题,顺着这个思路,我找到styles文件,报错中的4处错误都在这里:

既然找不到,我就尝试修改,最终发现打完@后,直接出现“style”,不用加“android:”,于是将这4个错误中的android:全部删除,然后就好了。

发布了9 篇原创文章 · 获赞 11 · 访问量 1万+
展开阅读全文

android studio 混淆打包时报错不到解决方案求帮助啊

09-07

混淆打包,报错,百度也查不到,困扰1天了。。。 Error:ProGuard: [JinFu1.1] java.io.IOException: Can't read [C:\Users\admin\.AndroidStudio1.2\system\compile-server\_temp_\proguard_input0.jar] (Can't process class [cn/sharesdk/onekeyshare/CustomerLogo.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) Error:ProGuard: [JinFu1.1] at proguard.InputReader.readInput(InputReader.java:230) Error:ProGuard: [JinFu1.1] at proguard.InputReader.readInput(InputReader.java:200) Error:ProGuard: [JinFu1.1] at proguard.InputReader.readInput(InputReader.java:178) Error:ProGuard: [JinFu1.1] at proguard.InputReader.execute(InputReader.java:78) Error:ProGuard: [JinFu1.1] at proguard.ProGuard.readInput(ProGuard.java:196) Error:ProGuard: [JinFu1.1] at proguard.ProGuard.execute(ProGuard.java:78) Error:ProGuard: [JinFu1.1] at proguard.ProGuard.main(ProGuard.java:492) Error:ProGuard: [JinFu1.1] Caused by: java.io.IOException: Can't process class [cn/sharesdk/onekeyshare/CustomerLogo.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)) Error:ProGuard: [JinFu1.1] at proguard.io.ClassReader.read(ClassReader.java:112) Error:ProGuard: [JinFu1.1] at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) Error:ProGuard: [JinFu1.1] at proguard.io.JarReader.read(JarReader.java:65) Error:ProGuard: [JinFu1.1] at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65) Error:ProGuard: [JinFu1.1] at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53) Error:ProGuard: [JinFu1.1] at proguard.InputReader.readInput(InputReader.java:226) Error:ProGuard: [JinFu1.1] ... 6 more Error:ProGuard: [JinFu1.1] Caused by: java.lang.UnsupportedOperationException: Unsupported class version number [52.0] (maximum 51.0, Java 1.7) Error:ProGuard: [JinFu1.1] at proguard.classfile.util.ClassUtil.checkVersionNumbers(ClassUtil.java:140) Error:ProGuard: [JinFu1.1] at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:88) Error:ProGuard: [JinFu1.1] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346) Error:ProGuard: [JinFu1.1] at proguard.io.ClassReader.read(ClassReader.java:91) Error:ProGuard: [JinFu1.1] ... 11 more 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览