Android : Branch SDK Crash Issue in production build - android

I am using Branch SDK in my application (latest version of Android Branch SDK (v4.3.2))
Since last update I am facing class not found issue in production release. But in development it works without any issues. Here is the crash log from firebase.
Fatal Exception: java.lang.RuntimeException
Unable to instantiate receiver io.branch.referral.InstallListener: java.lang.ClassNotFoundException: Didn't find class "io.branch.referral.InstallListener" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/gman.vedicastro-dnsDZX6uCyAilVBlCp8zjQ==/base.apk"],nativeLibraryDirectories=[/data/app/gman.vedicastro-dnsDZX6uCyAilVBlCp8zjQ==/lib/arm64, /system/lib64]]
Caused by java.lang.ClassNotFoundException
Didn't find class "io.branch.referral.InstallListener" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/gman.vedicastro-dnsDZX6uCyAilVBlCp8zjQ==/base.apk"],nativeLibraryDirectories=[/data/app/gman.vedicastro-dnsDZX6uCyAilVBlCp8zjQ==/lib/arm64, /system/lib64]]
As per the document from branch, I have removed this code from Android Manifest file
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
   <intent-filter>
   <action android:name="com.android.vending.INSTALL_REFERRER" />
   </intent-filter>
</receiver>
Any idea why this issue happened?
Please help me to resolve this. Thanks.

It could be a cache issue particularly when multidex builds are involved. I did following steps and it solves the problem - 
Disabling instant run on Android Studio.
Running the following command  ./gradlew clean && ./gradlew cleanbuildcache (note syntax is slightly different on Windows).
Finally relaunch Android Studio via File -> Invalidate caches / restart ...
Also, please double check the latest Android SDK (v4.3.2) documentation and confirm that you have added all the necessary command/code in all of the files. Here's the link to the latest doc - https://docs.branch.io/apps/android/
I hope this helps to someone.
Happy Coding :)

Thanks for notifying us.
Our docs are currently all updated. On the bottom of each doc page, we notify on the last updated date for the docs.

Related

GCM push noti in Unity3d causes gms.iid.InstanceID classnotfound

I have made an Android plugin to use GCM in my Unity app. When I try to start the RegistrationIntentService (readymade example class from Android Developer Manual site), it causes a crash with the exception
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.iid.InstanceID" on path: DexPathList[[zip file "/data/app/com.ex.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.ex.test-1/lib/arm, /vendor/lib, /system/lib]]
I have imported the play-services-9.2.0.unitypackage, without any success. Any help?
For anyone who might want to look for this question answered, I found the solution. The InstanceID.class is not included in the play-services-9.2.0.unitypackage, so include the play-services-iid-9.0.2.aar in the Android -> Plugins folder.

android:targetPackage cannot resolve symbol

this might seem trivial but I can't understand why I'm getting this error.
I downloaded the sample app activityInstrumentation( from Android Studio File -> import Sample) and inside the testing project manifest I get an unresolved symbol for
android:targetPackage="com.example.android.activityinstrumentation".
After that I've created a manifest for my application and still there is an unresolved symbol on the attribute.
My application project dir and test project dir are:
app/src/main/java/com/example/appname
where manifest has
package="com.example.appname"
app/src/androidTest/java/com/example/appname
where manifest has
<manifest
...
package="com.example.appname.tests"
...
android:targetPackage="com.example.appname"
...
</manifest>
Please help me sort this out. I don't know what else I can do: using a sample app to create a full fledged test project was my very last hope.
You must specify android:targetPackage in instrumentation tag.
[http://developer.android.com/guide/topics/manifest/instrumentation-element.html
]
I see the same thing. Seems to be only false alert produced by the lint code inspection. When you run analysis (Analyze->Inspect code...) and open "Inspection" tab you can select the warning and mark it Suppress for tag. That will get rid of the warning.

android ClassNotFoundException after trying to change minimum sdk

I am really getting desperate.
I have a working app - theoretically.
Tried to change the sdk version from 8 to 13.
Now when I start the app I get a Fatal exception, or rather a ClassNotFoundException for the very first activity started:
10-15 16:56:22.370: E/AndroidRuntime(862): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.pris/com.example.pris.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.pris.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.pris-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.pris-1, /system/lib]]
Apparently there seems to be some mixup with paths, but I have not the slightes idea where, or how to fix this.
Please help!
clean rebuild and restart project.. btw do you have any additional libraries??
if so get rid of them
lol..

Interactive Chart sample from google developers showing error eclipse

I just import project.I get error signs at res and src folders. I decided to create a project from existing code.I still get error.I get errors not for all project but for a few projects,mainly all google samples:
java.lang.reflect.InvocationTargetException
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:677)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:590)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$3.execute(NewProjectCreator.java:400)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:175)
at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
at org.eclipse.core.internal.resources.Project.create(Project.java:287)
at org.eclipse.core.internal.resources.Project.create(Project.java:269)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:727)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:660)
... 6 more
Root exception:
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:175)
at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
at org.eclipse.core.internal.resources.Project.create(Project.java:287)
at org.eclipse.core.internal.resources.Project.create(Project.java:269)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:727)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:660)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:590)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$3.execute(NewProjectCreator.java:400)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: OK
Contains: C:\Users\ramapriya\workspace\InteractiveChart overlaps the location of another project: 'InteractiveChart'
I restarted eclipse.my computer,cleared all projects.Got no clue how to solve this.
Thanks
EDIT: I need to mention that some projects run successfully with no errors(before) now show errors.The projects work just fine/
So I tried changing the themes,the java files.Nothing worked.All I had to do was:
Go to project properties(Right Click your project)
Go to Android Target,Click most Recent.
Ok, Apply,there you go! :D

Android Application class not found

In my application I use RoboGuice and the configuration for RoboGuice requires to add an Application-class and specify it in the AndroidManifest.xml file in the application-tag using the 'android:name' attribute.
So this is how my applicaiton-tag in the manifest looks like:
<application android:label="Worktime" android:icon="#drawable/logo" android:name=".guice.Application">
This always works and still does when I compile inside my IDE (IntelliJ) and deploy it to my device.
However when I want to run my tests using Ant (and only via Ant, this also still works in the IDE) I have this error on the console:
[exec] android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests:INSTRUMENTATION_RESULT: shortMsg=Unable to instantiate application eu.vranckaert.worktime.guice.Application: java.lang.ClassNotFoundException: eu.vranckaert.worktime.guice.Application in loader dalvik.system.PathClassLoader#44e88928
[exec] INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to instantiate application eu.vranckaert.worktime.guice.Application: java.lang.ClassNotFoundException: eu.vranckaert.worktime.guice.Application in loader dalvik.system.PathClassLoader#44e88928
This has worked before but started failing since I upgraded my 'Android SDK Tools' to revision 17 and the 'Android SDK Platform-tools' to revision 11.
Anyone who had this issue also or who knows how to fix it?
I think that the error saying
java.lang.ClassNotFoundException:
is occur only when you have create new class Activity and not declare(register) that in manifest file
please check if you have any new activity and not declare(register) that activity in manifest file
Thanks.
we might have encountered the same error - In my case the solution was to separate the Ant targets to two calls (i.e. "ant myParameters myTarget1 myTarget2", and "ant myParameters debug delivery"). Hope this works for you, anyhow - Google need to add better support for their undocumented/faulty changes (and stackoverflow isn't the best place for questions that are not originated in stupidity, as the lifetime of a complex question isn't too long here).

Categories

Resources