4
votes

I'm created a jar file for my appengine (python) application. I've followed the steps to import my library (.jar) files from this example. It seems Android Studio imported everything correctly (no error) until I try to use the classes in the library. I started to open up the classes that are contained in the jar files to see if everything looked to be in order. This is what I found:

enter image description here

UserMessage does not contain any errors.

enter image description here

Can anyone help explain why the classes can't see/use each other? Is this an issue with the jar or Android studio?

1
I see the IDE is coloring the class names red, but what's its actual error message? - Scott Barta
@Scott Barta The UserMessage class has no error and it is part of the same jar/package as the Broowes. But the Broowes class is saying that the symbol "UserMessage" can not be resolved. Because UserMessage and Broowes are both imported jar files they are locked and I can't modify them at all. Could this be an error in the endpoints python command line tool that created the jar or is it an import issue? - Brew Coder
If the only errors you're seeing are inside the jar files themselves, I wouldn't worry about it too much. The compiler doesn't need to compile anything inside the jars, so what the syntax highligher thinks of the classes is moot. - Scott Barta
The jar file does not seem to work in eclipse either. I guess I won't be able to use python with endpoints. I've spent so much time researching the tool chain and everything was working perfectly with the api explorer. Very disappointing but thank you for the help. - Brew Coder
I'm having the exact same problem. Added my generated .jar to libs, added it as a library, but nothing is resolving when I try to use it in Android Studio. Very frustrated. - k_day

1 Answers

1
votes

I had the same problem with Android Studio and Eclipse. My solution is probably not the best and the easiest, but it works.

What I did is I extracted the code from the .jar file and placed it inside src.

Now I have something similar to the following structure:

sample project tree