Error when testing new versions of Google Fit Samples,
Process: com.google.android.gms.fit.samples.basicrecordingapi, PID: 22949
java.lang.NullPointerException: Attempt to invoke virtual method 'android.accounts.Account com.google.android.gms.auth.api.signin.GoogleSignInAccount.getAccount()' on a null object reference
at com.google.android.gms.common.api.GoogleApi.zzagd(Unknown Source)
at com.google.android.gms.common.api.GoogleApi.zza(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.<init>(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
the methods have changed and I have noticed that since then, my application that uses the old methods does not register the data for DataTypes TYPE_ACTIVITY_SEGMENT, TYPE_STEP_COUNT_DELTA and sometimes TYPE_HEART_RATE_BPM. What is the solution?
Related
We sometimes throw new exception without specifying exception message.
For example:
throw new NullPointerException();
However, because of the above code, sometimes NullPointerException like below happens:
Exception: java.lang.NullPointerException: println needs a message
at android.os.Parcel.readException(Parcel.java:1605)
I think I could solve this problem by adding message like below:
throw new NullPointerException("blah");
However, what if I cannot find where the problem code is, and there are too many 'throw new NullPointerException();' so that I don't want to mess-up our company's project by adding exception message at all of the Exception codes.
I cannot modify Parcel.java because it is AOSP code.
Can I get some ideas? Should I track where in the source code uses Parcel.java?
The real crash exception I got is here:
java.lang.NullPointerException: println needs a message
at android.os.Parcel.readException(Parcel.java:1605)
at android.os.Parcel.readException(Parcel.java:1552)
at com.google.android.gms.internal.zzee.zzb(Unknown Source)
at com.google.android.gms.internal.zzdzm.zzd(Unknown Source)
at com.google.android.gms.internal.zzdzr.zza(Unknown Source)
at com.google.android.gms.common.api.internal.zzm.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzc.zza(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.zzakz(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.onConnected(Unknown Source)
at com.google.android.gms.common.internal.zzac.onConnected$51662RJ4E9NMIP1FDTPIUGJLDPI6OP9R55B0____0(Unknown Source)
at com.google.android.gms.common.internal.zzn.zzamz(Unknown Source)
at com.google.android.gms.common.internal.zze.zzy(Unknown Source)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
I have a crash reported by Fabric that during the check for the availability of Google Play Services that on Android 5 devices a crash can occur, particularly in OnePlus, Sony and Zuk devices.
I do not explicitly call this code directly and seems to be invoked by Google's own code.
According to other posts the exeption is thrown when the Parcel is too large, however since I do not control the process, my own code is not responsible for creating the Parcel.
I have checked the release notes for Google Play Services and other posts for no avail. Any suggestions are welcome.
Fatal Exception: java.lang.RuntimeException: Package manager has died
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:112)
at com.google.android.gms.common.zzo.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.connect(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by android.os.TransactionTooLargeException
at android.os.BinderProxy.transactNative(Binder.java)
at android.os.BinderProxy.transact(Binder.java:496)
at android.content.pm.IPackageManager$Stub$Proxy.getPackageInfo(IPackageManager.java:1876)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:107)
at com.google.android.gms.common.zzo.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.connect(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
According to official Android documentation, the key to avoiding TransactionTooLargeException is to
keep all transactions relatively small. Try to minimize the amount of
memory needed to create a Parcel for the arguments and the return
value of the remote procedure call. Avoid transferring huge arrays of
strings or large bitmaps. If possible, try to break up big requests
into smaller pieces.
My custom sender application is crashing whenever I'm clicking 'STOP CASTING' on the cast-options menu in the app. The error I'm getting is:
java.lang.NullPointerException: Attempt to write to field 'java.lang.ref.WeakReference android.support.v4.media.session.MediaSessionCompat$Callback.mSessionImpl' on a null object reference
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.setCallback(MediaSessionCompat.java:2305)
at android.support.v4.media.session.MediaSessionCompat.setCallback(MediaSessionCompat.java:267)
at android.support.v4.media.session.MediaSessionCompat.setCallback(MediaSessionCompat.java:255)
at com.google.android.gms.internal.zznv.zzen(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.zzei(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.zza(Unknown Source)
at com.google.android.gms.cast.framework.CastSession$zzb.zzei(Unknown Source)
at com.google.android.gms.cast.framework.zzf$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at zv.a(:com.google.android.gms.DynamiteModulesC:199)
at zl.a(:com.google.android.gms.DynamiteModulesC:128)
at aaa.onTransact(:com.google.android.gms.DynamiteModulesC:122)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.cast.framework.zzh$zza$zza.zzb(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.end(Unknown Source)
at com.google.android.gms.cast.framework.Session$zza.end(Unknown Source)
at com.google.android.gms.cast.framework.zzq$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at abc.a(:com.google.android.gms.DynamiteModulesC:216)
at abk.a(:com.google.android.gms.DynamiteModulesC:303)
at acg.a(:com.google.android.gms.DynamiteModulesC:70)
at acg.e(:com.google.android.gms.DynamiteModulesC:38)
at acd.onTransact(:com.google.android.gms.DynamiteModulesC:126)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.internal.zznn$zza$zza.zzg(Unknown Source)
at com.google.android.gms.internal.zznq.onRouteUnselected(Unknown Source)
at android.support.v7.media.MediaRouter$Callback.onRouteUnselected(MediaRouter.java:1787)
at android.support.v7.media.MediaRouter$GlobalMediaRouter$CallbackHandler.invokeCallback(MediaRouter.java:2999)
at android.support.v7.media.MediaRouter$GlobalMediaRouter$CallbackHandler.handleMessage(MediaRouter.java:2946)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
and I can't seem to find anyone with this error. I've followed https://github.com/googlecast/CastHelloText-android/ to the point. I will post the full activity here if it's wanted.
I've found answer on google issue tracking system on https://issuetracker.google.com/issues/37129745
In short, update v7 supprt library to 25.1.1
I have a Service that acts like an overlay with a chathead (like facebook messenger) when the user tap on this chatHead I pop a MapView (v2)
It works for the majority of my users, but in the bug report all the Xiaomi Xiaomi Redmi Note 3 users have the same crash
java.lang.RuntimeException: Unable to create service
com.package.MyService: java.lang.NullPointerException: Attempt to
invoke virtual method 'android.content.res.Configuration
android.content.res.Resources.getConfiguration()' on a null object
reference at
android.app.ActivityThread.handleCreateService(ActivityThread.java) at
android.app.ActivityThread.access$1800(ActivityThread.java) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java) at
android.os.Handler.dispatchMessage(Handler.java) at
android.os.Looper.loop(Looper.java) at
android.app.ActivityThread.main(ActivityThread.java) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) Caused by:
java.lang.NullPointerException: Attempt to invoke virtual method
'android.content.res.Configuration
android.content.res.Resources.getConfiguration()' on a null object
reference at android.view.SurfaceView.init(SurfaceView.java) at
android.view.SurfaceView.(SurfaceView.java) at
maps.V.x.(Unknown Source) at maps.V.v.(Unknown Source) at
maps.D.v.(Unknown Source) at maps.D.v.a(Unknown Source) at
maps.ad.ae.a(Unknown Source) at maps.ad.u.a(Unknown Source) at
maps.ad.R.a(Unknown Source) at
wc.onTransact(:com.google.android.gms.DynamiteModulesB:66) at
android.os.Binder.transact(Binder.java) at
com.google.android.gms.maps.a.e$a$a.a(Unknown Source) at
com.google.android.gms.maps.MapView$a.a(Unknown Source) at
com.google.android.gms.dynamic.e.a(Unknown Source) at
com.google.android.gms.dynamic.c.a(Unknown Source) at
com.google.android.gms.maps.MapView$b.g(Unknown Source) at
com.google.android.gms.maps.MapView$b.a(Unknown Source) at
com.google.android.gms.dynamic.b.a(Unknown Source) at
com.google.android.gms.dynamic.b.a(Unknown Source) at
com.google.android.gms.maps.MapView.a(Unknown Source)
The code that seems to fail is here
this.setTheme(R.style.AppTheme);
this.myView = LayoutInflater.from(this).inflate(R.layout.my_map, null);
this.mapView = (MapView) myView.findViewById(R.id.map);
this.mapView.onCreate(null);
this.mapView.getMapAsync(this);
The line that throws this error is
this.mapView.getMapAsync(this);
Anyone have a solution for this?
Try turning Hardware acceleration on in manifest
android:hardwareAccelerated="true"
it worked for me
source: https://code.google.com/p/gmaps-api-issues/issues/detail?id=9071
I'm using this Tutorial but after run app crash app and give me this error.
Error:
FATAL EXCEPTION: IntentService[]
Process: package-name, PID: 11869
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/yadbegir.jfa.mansoor.com.yadbegir/files/instant-run/dex/slice-realm-optional-api_82aa9dab5d973e04cc1850ef40d4e3808a75f9c1-classes.dex)
at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at package-name.service.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:33)
at package-name.service.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:25)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Try to update Google Play Services library to version 9.0.2
The Google Play services version 9.0.1 release is now available. This release fixes the following issues with the version 9.0.0 release:
Fixes a class change compilation error with ContextCompat.getNoBackupFilesDir().
Fixes a known issue with serving Admob ads on devices without the Google Play services APK when your app uses ProGuard post-processing.