0

If you are here, then like me you have scoured the entire internet looking for reasons why the latest version of the Swarm SDK is causing your exported and installed APK to crash, but working flawlessly while debugging via Eclipse.

Error message from Google Crash / ANR report:

android.content.ActivityNotFoundException: Unable to find explicit activity class
{com.robertmackness.jumprx.android/com.swarmconnect.de}; 
have you declared this activity in your AndroidManifest.xml?

I have tried the following fixes after way too much time Googling and reading official documents:

  1. Explicitly defining the activity in the Android manifest.

  2. As above but ensuring that manifestmerger.enabled=false.

  3. Removed definitions for the activity in my android manifest, set manifestmerger.enabled=true and ensure that this line was the second (after enabling pro-guard)

  4. Ensured that the project imported the library properly and ensured that the 'Properties->Java Build Path -> Order and Export -> SwarmConnect.jar was checked.

Again, all of the above solutions kept the debug app working but the exported apk broken in various ways.

Submitting solution below.

1 Answers1

0

So I had proguard configured and hadn't specified any of the class names to keep in the proguard-project.txt. I had also set it up so long ago that I had forgotten all about it..

I felt a little silly because this is the exact same reason why my Admob integration wouldn't work at first.

Put this into your proguard-project.txt to get things running:

-keep class com.swarmconnect.**{*;}

-keepattributes Signature

-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}