简体   繁体   English

无法解析Android Studio中导入的JAR中的符号

[英]Cannot resolve symbol inside JAR imported in Android Studio

I am trying to work with a jar which is of a previous project that has been properly tested and works fine. 我正在尝试使用一个罐子,该罐子是以前的项目的一个罐,该罐已经过正确测试并且可以正常工作。 I even decompiled the jar inside Android Studio and ran it and it worked fine as can be seen below: 我什至在Android Studio中反编译了jar,然后运行它,如下所示,它运行良好: 在此处输入图片说明

But the problem is this(HashTableClass.java and HashNodeClass.java are decompiled from the jar): 但是问题是这样的(HashTableClass.java和HashNodeClass.java是从jar中反编译的):

Only HashTableClass is being identified and all the other classes are not being identified 仅识别HashTableClass,而未识别所有其他类

这是我的build.gradle

My imported jar file contains multiple packages.Things that I have tried to get out of this mess: 1.Invalidate Cache/Restart 2.Sync Project with Gradle Files 我导入的jar文件包含多个包。我试图摆脱这种混乱的事情:1.使缓存无效/重新启动2.将项目与Gradle文件同步

One solution is explicit typing of the package name before the type name in the java files of the jar but that doesn't seem to be a good solution. 一种解决方案是在jar的java文件中的类型名称之前显式键入程序包名称,但这似乎不是一个好的解决方案。

My question is: How do I stop this "cannot resolve symbol" mess in my JAR effectively? 我的问题是: 如何有效地阻止JAR中的“无法解析符号”混乱?

我对JAR中的源文件做了一些小的更改,然后导入了一个新的JAR,问题得以解决。

我正在使用jsoup Jar文件,并且发生了这种情况,我通过从依赖项中删除它并再次添加来解决了该问题

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM