Error Importing Jar to Android Project

不羁岁月 提交于 2019-12-05 05:25:30

I saw a bunch of issues when I first updated as well, but was eventually able to get it working. Some suggestions, based on what eventually worked for me as well as a friend:

Make sure you have your external jars in a "libs" folder in the project's base directory (note the "s" here--not "lib"). If you make any changes, be sure to refresh the project and clean (then rebuild if not set to build automatically).

In your project properties under Java Build Path > Libraries tab, remove everything but the Android X.X.X and Android Dependencies nodes. Again if you make any changes, be sure to refresh the project and clean (then rebuild if not set to build automatically).

If you've done this for your project and all library projects it uses in your workspace and are still having trouble, try removing all Android library projects (from project properties > Android) as well as all libraries from the Java Build Path (including Android X.X.X and Android dependencies this time) from each, clean, and then changing the Android version/applying/changing it back to force a rebuild. (Do this for each project starting with your base library project, only adding them to your other projects once they build without errors).

Hope that helps.

Once try to clean your project and built it again...it might help you...because it help me...i was also having the same problem with my new sdk...

I got this error on a test project, when I was building with Maven. I solved it by adding

<scope>provided</scope>

to the android test libraries.

    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android-test</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!