4

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?

Brew Coder
  • 136
  • 8
  • I see the IDE is coloring the class names red, but what's its actual error message? – Scott Barta Mar 24 '14 at 16:31
  • @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 Mar 25 '14 at 02:30
  • 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 Mar 25 '14 at 16:06
  • 1
    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 Mar 26 '14 at 00:21
  • 1
    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 Apr 12 '14 at 18:35
  • k_day i ended up switching my project over to java since i had just started. But i really liked the Python interface. Please keep this thread posted if you figure it out. – Brew Coder Apr 13 '14 at 05:32
  • I am facing same issue with Eclipse. I have Python backend(module). Does anybody know the solution? If yes, please share – gsinha Apr 13 '14 at 19:58
  • I had raised a [google defect](https://code.google.com/p/googleappengine/issues/detail?id=10799) for it. You can star it if you see the issue as well(Google might fix it a bit quicker) – gsinha Apr 14 '14 at 08:57
  • @BrewCoder This answer might be helpful http://stackoverflow.com/a/23141051/1443563 – gsinha Apr 17 '14 at 18:49
  • @BrewCoder Did you find a solution? I am stuck with the same problem. – Gaurav Jun 29 '14 at 14:49
  • @gaurav I ended up switching to java for my backend. Not a good solution but i had a deadline for my prototype and waiting for a fix wasn't possible. – Brew Coder Jun 29 '14 at 15:13
  • I've answered this in another question, please see http://stackoverflow.com/a/26687597/596599 – PacificSky Nov 01 '14 at 08:50

1 Answers1

1

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

sam_dw
  • 159
  • 1
  • 13