I have imported a jar file containing a Java library into an Android Studio project by placing it in the app/libs folder. When attempting to import classes from the jar, Android Studio is able to autocomplete the package names, but does not show any specific classes. Attempting to build the project results in 'package does not exist' errors.
I am able to import other third party libraries stored in jars, so the issue seems to be with the specific jar file.
Is there some sort of special setup jar files require before being imported into Android Studio projects? My jar's manifest file is below:
Manifest-Version: 1.0
Created-By: 1.8.0_72 (Oracle Corporation)
Some additional information:
The library I am compiling (for testing purposes) has one file (named Adder.java), shown below:
public class Adder {
public int add(int x, int y) {
return x + y;
}
}
I am creating the jar as follows:
javac -source 1.7 -target 1.7 Adder.java
jar cf Adder.jar Adder.class