简体   繁体   English

java.lang.NoClassDefFoundError:解析失败:Lcom/google/gson/Gson;

[英]java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;

When I'm trying to run my application i get this error当我尝试运行我的应用程序时出现此错误

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;

this com.google.gson.Gson library file that I did added to my project through gradle and also added the libs/gson-2.8.1.jar file through Project Structure and can't understand when I have this problems. this com.google.gson.Gson library file that I did added to my project through gradle and also added the libs/gson-2.8.1.jar file through Project Structure and can't understand when I have this problems.

Here are a couple of reasons that this could be happening:以下是可能发生这种情况的几个原因:

a) The library jar file is not being included a) 不包含库 jar 文件

b) The wrong version of the jar file is being included b) 包含错误版本的 jar 文件

c) (if you are using maven) Another jar file is pulling in a newer/different version of the jar file c)(如果您使用的是 maven)另一个 jar 文件正在拉入 jar 文件的更新/不同版本

d) Your class path does not include the jar file. d) 您的 class 路径不包括 jar 文件。

note to self: ;-)注意自我: ;-)

implementation 'com.google.code.gson:gson:2.9.1'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java.lang.NoClassDefFoundError:解析失败:Lcom/google/firebase/FirebaseApp - Java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/FirebaseApp java.lang.NoClassDefFoundError: Failed resolution Failed resolution of: Lcom/google/android/gms/common/internal/zzab; - java.lang.NoClassDefFoundError: Failed resolution Failed resolution of: Lcom/google/android/gms/common/internal/zzab; 获取java.lang.NoClassDefFoundError:com / google / gson / Gson - Getting java.lang.NoClassDefFoundError: com/google/gson/Gson java.lang.NoClassDefFoundError:com / google / gson / Gson - java.lang.NoClassDefFoundError: com/google/gson/Gson Apache风暴-java.lang.NoClassDefFoundError:com / google / gson / Gson - Apache storm - java.lang.NoClassDefFoundError: com/google/gson/Gson 处理程序处理失败; 嵌套的异常是java.lang.NoClassDefFoundError:com / google / gson / Gson - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/google/gson/Gson java.lang.noClassDefFoundError:无法解决以下问题:Lcom / facebook / R $ style; - java.lang.noClassDefFoundError: Failed resolution of: Lcom/facebook/R$style; Gson java.lang.NoClassDefFoundError - Gson java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / common / internal / zzbp; - java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbp; java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / common / internal / zzbq附近的地方应用 - java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq Nearby Place App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM