0

I am currently porting a Android app to my phone and have made good progress. I have an error currently however and I have no idea what is wrong:

06 21:05:24.301 E/AndroidRuntime(2871): java.lang.AbstractMethodError: abstract method not implemented 04-06 21:05:24.301 E/AndroidRuntime(2871): at android.content.pm.PackageManager.getInstalledThemePackages(PackageManager.java) 04-06 21:05:24.301 E/AndroidRuntime(2871): at com.tmobile.thememanager.provider.ThemesProvider$VerifyInstalledThemesThread.verifyPackages(ThemesProvider.java:291) 04-06 21:05:24.301 E/AndroidRuntime(2871): at com.tmobile.thememanager.provider.ThemesProvider$VerifyInstalledThemesThread.run(ThemesProvider.java:230)

This is taken from a logcat by the way.

Here is the code of that Java file: Click Me

Ewan Smith
  • 1
  • 1
  • 1

2 Answers2

1

It is possible that you are making your code compatible with an older version of the Android API and that now a recent version has additional methods which would need to be implemented in order for it to run in recent versions.

I'm not sure if this is your problem, but assuming it is what is happening, you can load classes based on SDK version, as explained in this other post from Stack Overflow: android compability problem

Community
  • 1
  • 1
Luis Miguel Serrano
  • 5,029
  • 2
  • 41
  • 41
  • Well, I think I am back tracking from 2.3.7 to 2.3.4 – Ewan Smith Apr 07 '12 at 16:53
  • I am porting this app so that it is only meant to run on this one device - so how would I amend my files to make it work? – Ewan Smith Apr 07 '12 at 17:02
  • Try reloading the libraries you use in your project and fixing project properties. There is another post i have ran into, of a MAC user who managed to solve a similar issue by doing so: http://stackoverflow.com/questions/8582555/android-sdk-manager-java-loading-sources-exception-on-os-x – Luis Miguel Serrano Apr 07 '12 at 21:05
  • Well the one thing I don't understand is if the error is saying that it is not implemented into Android or into My Source Code. – Ewan Smith Apr 08 '12 at 10:57
  • The error is because of your code or a library used by your code. Try looking at the link present in the first link i gave: http://stackoverflow.com/questions/2989459/load-class-based-on-sdk-version and check out the example source code from the accepted answer. See if you can apply the same principles suggested there and if it solves your problem. If it doesn't, I'm not sure what else you can do to fix this. – Luis Miguel Serrano Apr 08 '12 at 13:07
  • I dont think you understand what I am saying - THIS IS NOT FOR MULTIPLE DEVICES/OS VERSIONS. I simply need the fix the error on this one device. – Ewan Smith Apr 10 '12 at 17:35
  • Sorry, it was just a suggestion. I know you intend to port it only for your device, but the fact is that it may contain specific libraries which were meant to target other phones, and which you might have to remove in order to make it work with yours. In any case, one thing which might be able to help you is setting the target min SDK attribute from the manifest to the API level specific to your device. – Luis Miguel Serrano Apr 10 '12 at 19:06
  • That's the problem, I dont know what libraries to remove. – Ewan Smith Apr 11 '12 at 09:51
  • I am not sure either, but since that class seems to come in a pack of its own, provided you do not have the source code directly in your project, you might have one or multiple jar libraries in use related to it. In any case, if you can please list the libraries currently in use by your Android project. It will not necessarily help but then again it might give an additional clue. – Luis Miguel Serrano Apr 11 '12 at 21:32
  • The thing is - I am not experienced with Java, so all this makes no sense what so ever. – Ewan Smith Apr 14 '12 at 18:30
  • Which IDE do you use for the development? Assuming it is Eclipse, you can check the libraries currently use by your project, doing the following: On the left of the screen, right click on your Project and select: Build Path -> Configure Build Path. Then in the window that pops up, select the Libraries tab. For each library, you can expand it and see its .jar files. Alternatively, you can just expand your project folder in Eclipse and expand the entries with the books icon (libraries), to see which .jar files they have, which are in use by your project. – Luis Miguel Serrano Apr 22 '12 at 23:17
0

I had a similar problem when using retrofit and OKHttp. In my case I had to change the following:

  • compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
  • compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'

to:

  • compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
  • compile 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'

it helped me to avoid the error.

nicolas asinovich
  • 3,201
  • 3
  • 27
  • 37