Unable to instantiate receiver com.google.android.apps.analytics.AnalyticsReceiver - android

I have uploaded the Android app into playstore. While downloading it for the first time it gets crashed but after that it works fine. Its showing the error as Unable to instantiate receiver com.google.android.apps.analytics.AnalyticsReceiver Caused by java.lang.ClassNotFoundException: Didn't find class "com.google.android.apps.analytics.AnalyticsReceiver" .
How to resolve this issue?

I believe that issue related to your manifest file and refer to INSTALL_REFERRER.
Make sure if AnalyticsReceiver class included to your app
My suggestion, if you not use that receiver you can remove it, otherwise will keep throw crash error
Note:
As far as I know com.google.android.apps.analytics.AnalyticsReceiver from Google Analytics SDK v3
While if you using Google Analytics SDK v4 you should use com.google.android.gms.analytics.CampaignTrackingReceiver
Please read this post too

Related

App crashes when downloaded from Google Play

I've just built and deployed an app to Google Play. It worked well when I was running it through Android Studio but now it crashes when I download it from Google Play. Because this is my first time, I don't even know how to view the crash report/stacktrace of the app that was downloaded from Google Play. I appreciate any and all help.
UPDATE
So I got the stacktrace for the APK. It tells me that my TopImageFragment.java class cannot create my MemeViewModel.java class. I have no clue why its giving this error. Everything works fine as it is. It seems that proguard is indeed phasing out an important class:
2019-04-18 00:46:32.062 8099-8099/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ozbek.onur.memegenerator, PID: 8099
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ozbek.onur.memegenerator/com.ozbek.onur.memegenerator.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6703)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
Caused by: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
at android.arch.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:155)
at android.arch.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:210)
at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:134)
at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:102)
at com.ozbek.onur.memegenerator.TopImageFragment.onActivityCreated(TopImageFragment.java:89)
This kind of problem usually happens because your app deployed to Google Play was a release build and proguard minified your app and removed a class it shouldn't have. When you build in Android Studio it is a debug build that does not get minified. That's why you see the crash only from Google Play.
Before uploading to Google Play, test out your release APK file on a device and watch logcat for the error. That should tell you what class got removed by mistake and you can correct that by specifying custom proguard rules and trying again until the app stops crashing. Then when you upload to Google Play, you should be good.
You can also enable proguard in a debug build as well by changing your build.gradle file. Then when you run through Android Studio, you should see the same error as you see through Google Play.
One other alternative, you can disable proguard/minification in your release build. However this is not recommended because your app will be larger than it needs to be.
Check if you have any java files that don't have an access modifier. In my experience, just declaring a class without a public or private modifier, causes this problem.
My app suffered the same problem and it was a ProGuard kill.
Because ProGuard renames all classes unless otherwise instructed.
So, in your case, you have to add
#Keep
annotation before your class name MemeViewModel.
example,
#Keep
class MemeViewModel{
//
//
}
In my suggestion, keep your phone connected to your your PC/Laptop while you download and attempt to open it. Use Logcat on android studio, it mostly has all answers or at least errors that lead to the answers. try putting error logs here so we can have a proper look at it.
1) Try the same version of your application that you deployed on Google play store by pushing it through the android studio and see if the problem continues!
2) If same thing happens then put breakpoint on the entry point (onCreate method in most cases in MainActivity class) of your application and Go to Run->Debug "YourProject" option and do step by step debug for each command being executed and see which one is causing problem.

Unable to start activity. java.lang.IllegalStateException: Client not initialized

I would love some help. I am new using dropbox api, I am using the resources available here:https://github.com/dropbox/dropbox-sdk-java
It is working fine, I can upload files perfectly, but then, when I download a file, you can see that is downloaded but then the app crashes with the following error:
Caused by: java.lang.IllegalStateException: Client not initialized.
This is my git repository, https://github.com/ghilbing/ProbandoDropbox
If you can help me find the error, I would be really thankful.
Thanks in advance for your help.

Android Google Maps gives a ClassNotFoundException

I am creating an app tht uses Google Maps API v2. It works fine, except for a little annoying this, when I use the setMyLocationEnabled(true); method, I get a ClassNotFoundException. I can just click "Resume" and the app continues. When running without debugger, there is nothing you can see happening.
This is what LogCat is saying:
09-23 22:39:31.645: I/dalvikvm(2067): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lglm;'
09-23 22:39:31.645: W/dalvikvm(2067): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
09-23 22:39:32.473: W/dalvikvm(2067): VFY: unable to resolve static field 4203 (CREATOR) in Lcom/google/android/gms/location/internal/ParcelableGeofence;
It looks like a missing class in the library, and if I jump into the library project, I indeed do not see that class.
Is there anything I can add / fix to make this exception go away?
I have seen that logcat error before and I noticed it is due to mismatch in my API key between debug and release mode. If you are using separate key store for debug, please make sure you have included both debug and release SHA1+package.name combos in the Google Dev Console.

RuntimeException: unable to instantiate application - Class not found?

I've been developing an app for some time now and have been deploying it straight to my device for testing. However, as the development is coming to a close, I've made the first version available on the google play store.
However, after downloading the app from the play store, it crashes immediately on startup. Fortunately android allows the end user to examine the stack trace, which appears as:
java.lang.RuntimeException: Unable to instantiate application com.jysoftware.jyapp.CustomApp:
java.lang.ClassNotFoundException: Didn't find class "com.jysoftware.jyapp.CustomApp"
on path: DexPathList[[zip file "/data/app/com.jysoftware.jyapp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.jysoftware.jyapp-1, /vendor/lib, /system/lib]] .......
The ClassNotFound is the same class as referenced in my manifest as:
<application
android:name="com.jysoftware.jyapp.CustomApp"
....
</application>
Any ideas what could be causing this, or where I should start to look? I'm at a loss as to why this should work when it is directly deployed from eclipse but does not work when downloaded from the play store.

java.lang.NoClassDefFoundError on Android with GoogleAccountCredential.newChooseAccountIntent()

I am developing for Android 4+ with Eclipse Juno ADT bundle + Google Plugin for Eclipse.
I need to programmatically log into a google account to use the Google Calendar API. For
this I am making use of account manager. I get the following error:
05-05 13:28:55.605: E/AndroidRuntime(11186): FATAL EXCEPTION: main
05-05 13:28:55.605: E/AndroidRuntime(11186): java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
05-05 13:28:55.605: E/AndroidRuntime(11186): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)
05-05 13:28:55.605: E/AndroidRuntime(11186): ...
Here is the code that causes it:
GoogleAccountCredential credential;
credential = GoogleAccountCredential.usingOAuth2(this, CalendarScopes.CALENDAR);
chooseAccount();
private void chooseAccount() {
startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);
}
I have searched stackoverflow for solutions. The libs directory contains the calendar
library files for eclipse I imported via google plugin for eclipse (which also put
there the authentication etc... libraries):
android-support-v4.jar
google-api-client-1.14.1-beta.jar
google-api-client-android-1.14.1-beta.jar
google-api-services-calendar-v3-rev41-1.14.2-beta.jar
google-http-client-1.14.1-beta.jar
google-http-client-android-1.14.1-beta.jar
google-http-client-gson-1.14.1-beta.jar
google-http-client-jackson-1.14.1-beta.jar
google-http-client-jackson2-1.14.1-beta.jar
google-oauth-client-1.14.1-beta.jar
gson-2.1.jar
jackson-core-2.1.3.jar
jackson-core-asl-1.9.11.jar
jsr305-1.3.9.jar
These however do not seem to include
com.google.android.gms.common.AccountPicker
If I import this in my code the import line of code is flagged as an error.
So what's up. I've copied this code from the Google Calendar Sample where it
runs just fine:
http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/
That code has exactly the same libs except:
calendar lib is rev33 instead of rev41
jackson and jackson-asl libraries are missing
.properties file for each library file present in sample code but not in my code
So this should not be the problem. However,
looking in the imports section of the code, the google calendar sample code has:
import com.google.android.gms.common.GooglePlayServicesUtil;
but if I try to insert this line of code in my code it is tagged as an error
saying the import com.google.android.gms.common.GooglePlayServicesUtil
cannot be resolved.
This post
java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
says they were able to
import com.google.android.gms.common.AccountPicker;
But I'd like to know what library that came from.
I even tried looking in the original android calendar sample for the
library from which I can include com.google.android.gms.common.*
by inspecting one file at a time but could not find it. How
is it possible?
What am I doing wrong?
Thanks very very much for all your help.
OK, I've found out what I was missing.
Ensure you have downloaded the Android SDK Services -> Extras -> Google Play services
Follow the instructions provided by the following link
to add the google-play-services-lib library to your project:
http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject
Best Regards
I've run into a similar problem lately. My app (not in production yet) would suddenly (since the beginning of May) start throwing uncatchable 'NoClassDefFoundError' error when calling
GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE_FILE)
method. It was happening randomly, usually first time in the morning. I could fix it by re-installing my Google account. Not a good solution for production, though. I've spent frustrating couple of hours trying to resolve it until I finally realized I have another app that does not have the same problem in the same code sequence. So I diff-ed both of them and realized that the "good" one had a different sequence of entries in 'Package Explorer->Project->Properties->Java Build Path' The 'good' one had
'google-play-services.jar' BEFORE
'android-support-v4.jar',
where the 'bad' one had it backwards. So I switched the sequence (using UP, DOWN buttons in the dialog) and it seems to solve the problem. Yet another WT... ? moment! Does anybody have an opinion on this?

Categories

Resources