Skip to content Skip to sidebar Skip to footer

Android - Unable To Resolve Superclass

I have dug out an old android project that I was working on a few years ago and loaded it into a new eclipse install (latest ADT etc). The project all compiles ok (after some mino

Solution 1:

I had the same problem. I had a custom View class which called methods in an imported library. I was also getting the "Unable to resolve superclass" error when the app was trying to create my view (while trying to inflate a layout that referred to that custom View).

I resolved my problem, and I had a play around to determine what I think is the definitive answer.

(As at writing, I am using the Eclipse Android Tools R21).

If you are using an external jar

  • Copy it to your project's "libs" folder. The Android Tools should do the rest.

If the library you want to use is a separate project in your workspace.

  • In your library project: go into Properties->Android and check the "Is Library" checkbox.
  • In your app project: go into to Properties->Android and add the library project in the same section there (click "Add.."). Don't check "Is Library" here!

Some answers to this question say you need to go to Properties->Java Build Path->Projects and add the library project there. For normal Java projects you would do that, but it appears the Android Tools don't need or use that.

Finally, you will probably want to make sure the lib is included in your exported app

  • Go to Properties->Java Build Path->Order and Export and make sure the library is checked.

Solution 2:

Ok, was a simple problem in the end..

Having added the 3rd party library to the build path, the export tab wasnt defaulted to export the jar (eclipse normal behaviour) - so the jar wasnt being included in the deployment..

got past that problem ok..

Solution 3:

I had the same problem, I tried to check the Android Private Libraries under Order and Export and it didn't work for me. So then I noticed that my libs folder wasn't referenced under the Java Build Path, I just added it to Libraries and that is it...

Post a Comment for "Android - Unable To Resolve Superclass"