1

I am trying to export an android application that uses a couple different libraries. Two of the libraries are jar files but the other libraries are linked projects. For instance one of the libraries is a mapview balloon view. To use the library, I added the project to my workspace, go to project properties for it and under Android I marked the project as "use as library". And then in the application I am building, I linked the project library using its path (in the Android menu). The application exports correctly however when I try to run the app on my dev phone it crashes with the following error:

07-06 13:50:00.238: ERROR/AndroidRuntime(3282): Caused by: java.lang.ClassNotFoundException: com.markupartist.android.widget.ScrollingTextView in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.alltrails-1.apk]

My proguard file contains the following:

-dontwarn -dontnote -dontskipnonpubliclibraryclasses -libraryjars libs/osmdroid-android-3.0.4.jar -libraryjars libs/osmdroid-google-3.0.4.jar -libraryjars libs/slf4j-android-1.5.8.jar -libraryjars /Applications/android-sdk-mac_x86/add-ons/addon_google_apis_google_inc_4/libs/maps.jar

Thanks in advance!!

kevin78925
  • 15
  • 2
  • 5

1 Answers1

0

The class com.markupartist.android.widget.ScrollingTextView is missing from your application. If it is in one of the library jars, you should specify that jar as a program jar (-injars), since the contents of library jars don't get copied into the output jar.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • 2
    Thank you Eric for the reply. I actually fixed the issue. The markupartist package was a "library project" (a project in my workspace and I linked my actual project to it) so I had to add the following in my proguard.cfg: -keep public class com.markupartist.android.** { public protected *; } – kevin78925 Jul 08 '11 at 05:49
  • In that case, it might be sufficient to just keep the class ScrollingTextView (and maybe some non-default constructor). The library code is just ordinary program code, as far as ProGuard is concerned. Keeping all public library classes and class members is only required if the processed code is to be used as a general library. – Eric Lafortune Jul 09 '11 at 22:22