I made a chatting app which is continuosly showing errors - android

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.firebase.udacity.friendlychat, PID: 28266
com.google.firebase.database.DatabaseException: Class com.google.firebase.udacity.friendlychat.FriendlyMessage is missing a constructor with no arguments
at com.google.android.gms.internal.zzbqi$zza.zze(Unknown Source)
at com.google.android.gms.internal.zzbqi$zza.zzaG(Unknown Source)
at com.google.android.gms.internal.zzbqi.zze(Unknown Source)
at com.google.android.gms.internal.zzbqi.zzb(Unknown Source)
at com.google.android.gms.internal.zzbqi.zza(Unknown Source)
at com.google.firebase.database.DataSnapshot.getValue(Unknown Source)
at com.google.firebase.udacity.friendlychat.MainActivity$6.onChildAdded(MainActivity.java:290)
at com.google.android.gms.internal.zzblz.zza(Unknown Source)
at com.google.android.gms.internal.zzbnz.zzYj(Unknown Source)
at com.google.android.gms.internal.zzboc$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

As your error message says:
com.google.firebase.udacity.friendlychat.FriendlyMessage is missing a constructor with no arguments
So you must be missing a default constructor (constructor with no arguments) in your FriendlyMessage class

Related

android getting null pointer exception at java.util.Objects.requireNonNull(Objects.java:203)

I'm reading writing string arrays and displaying them in recycler view.
Before displaying them i'm reversing the order using
Collections.reverse(Arrays.asList(FilePathStrings));
Following is exception that I'm getting:
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.Arrays$ArrayList.<init>(Arrays.java:3826)
at java.util.Arrays.asList(Arrays.java:3813)
at com.example.soberapps.nightcamera.b.c.a(Unknown Source)
at android.support.v4.app.i.b(Unknown Source)
at android.support.v4.app.o.a(Unknown Source)
at android.support.v4.app.o.e(Unknown Source)
at android.support.v4.app.o.a(Unknown Source)
at android.support.v4.app.c.d(Unknown Source)
at android.support.v4.app.o.b(Unknown Source)
at android.support.v4.app.o.a(Unknown Source)
at android.support.v4.app.o.b(Unknown Source)
at android.support.v4.app.o.h(Unknown Source)
at android.support.v4.app.o$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:164)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:156)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:75)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:50)
at androidx.test.espresso.action.Tap.c(Tap.java:8)
at androidx.test.espresso.action.Tap.a(Tap.java:18)
at androidx.test.espresso.action.Tap$1.b(Tap.java:3)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Error reporting crash
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contains(java.lang.CharSequence)' on a null object reference
at android.os.Parcel.readException(Parcel.java:1689)
at android.os.Parcel.readException(Parcel.java:1636)
at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerProxy.java:5217)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:97)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
Arrays.asList(null) throws this exception. Your parameter (FilePathStrings) equals to null.

Firebase ArrayList issues (need to use GenericTypeIndicator?)

Connecting to my Firebase database works fine when I install my app to my phone via USB. But when I install it via the Play Store, I get issues from Firebase about my ArrayList having "generic type parameters". Check out the first line of the logcat error message below:
09-14 15:59:55.715 4843-4843/? E/UncaughtException: com.google.firebase.database.f: Class java.util.ArrayList has generic type parameters, please use GenericTypeIndicator instead
at com.google.android.gms.c.mu.b(Unknown Source)
at com.google.android.gms.c.mu.b(Unknown Source)
at com.google.android.gms.c.mu.a(Unknown Source)
at com.google.android.gms.c.mv.a(Unknown Source)
at com.google.android.gms.c.mv.a(Unknown Source)
at com.google.android.gms.c.mu.d(Unknown Source)
at com.google.android.gms.c.mu.b(Unknown Source)
at com.google.android.gms.c.mu.a(Unknown Source)
at com.google.firebase.database.b.a(Unknown Source)
at com.test.finalapp.Activities.c.a(Unknown Source)
at com.google.android.gms.c.ha.a(Unknown Source)
at com.google.android.gms.c.iv.b(Unknown Source)
at com.google.android.gms.c.jb.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
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)
Any thoughts? The Google Play version was working fine the other day and now this happened! Couldn't find any solutions online...
UPDATE:
I added the following code to my proguard-rules.pro file:
-keepattributes Signature
-keepclassmembers class com.test.finalapp.Models.** {
*;
}
-keep class com.test.finalapp.CoOpStatusHolder { *; }
Things are working fine in database, but now I'm hit with the error: java.lang.RuntimeException: java.lang.NoSuchMethodException: [class android.view.View]
That error is at the top of the larger logcat error:
09-15 12:06:23.041 32250-32250/? E/UncaughtException: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.view.View]
at com.firebase.ui.a.d.b(Unknown Source)
at android.support.v7.widget.em.c(Unknown Source)
at android.support.v7.widget.fe.a(Unknown Source)
at android.support.v7.widget.fe.c(Unknown Source)
at android.support.v7.widget.dl.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.c(Unknown Source)
at android.support.v7.widget.RecyclerView.J(Unknown Source)
at android.support.v7.widget.RecyclerView.k(Unknown Source)
at android.support.v7.widget.RecyclerView.t(Unknown Source)
at android.support.v7.widget.RecyclerView.c(Unknown Source)
at android.support.v7.widget.eg.run(Unknown Source)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
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)
Caused by: java.lang.NoSuchMethodException: <init> [class android.view.View]
at java.lang.Class.getConstructor(Class.java:528)
at java.lang.Class.getConstructor(Class.java:492)
at com.firebase.ui.a.d.b(Unknown Source) 
at android.support.v7.widget.em.c(Unknown Source) 
at android.support.v7.widget.fe.a(Unknown Source) 
at android.support.v7.widget.fe.c(Unknown Source) 
at android.support.v7.widget.dl.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.c(Unknown Source) 
at android.support.v7.widget.RecyclerView.J(Unknown Source) 
at android.support.v7.widget.RecyclerView.k(Unknown Source) 
at android.support.v7.widget.RecyclerView.t(Unknown Source) 
at android.support.v7.widget.RecyclerView.c(Unknown Source) 
at android.support.v7.widget.eg.run(Unknown Source) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
at android.view.Choreographer.doFrame(Choreographer.java:603) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:152) 
at android.app.ActivityThread.main(ActivityThread.java:5507) 
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) 
09-15 12:06:23.242 32250-32250/? D/FirebaseCrashApiImpl: throwable java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.view.View]
--------- beginning of crash
09-15 12:06:23.278 32250-32250/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.finalapp, PID: 32250
java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.view.View]
at com.firebase.ui.a.d.b(Unknown Source)
at android.support.v7.widget.em.c(Unknown Source)
at android.support.v7.widget.fe.a(Unknown Source)
at android.support.v7.widget.fe.c(Unknown Source)
at android.support.v7.widget.dl.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
at android.support.v7.widget.LinearLayoutManager.c(Unknown Source)
at android.support.v7.widget.RecyclerView.J(Unknown Source)
at android.support.v7.widget.RecyclerView.k(Unknown Source)
at android.support.v7.widget.RecyclerView.t(Unknown Source)
at android.support.v7.widget.RecyclerView.c(Unknown Source)
at android.support.v7.widget.eg.run(Unknown Source)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
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)
Caused by: java.lang.NoSuchMethodException: <init> [class android.view.View]
at java.lang.Class.getConstructor(Class.java:528)
at java.lang.Class.getConstructor(Class.java:492)
at com.firebase.ui.a.d.b(Unknown Source) 
at android.support.v7.widget.em.c(Unknown Source) 
at android.support.v7.widget.fe.a(Unknown Source) 
at android.support.v7.widget.fe.c(Unknown Source) 
at android.support.v7.widget.dl.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.a(Unknown Source) 
at android.support.v7.widget.LinearLayoutManager.c(Unknown Source) 
at android.support.v7.widget.RecyclerView.J(Unknown Source) 
at android.support.v7.widget.RecyclerView.k(Unknown Source) 
at android.support.v7.widget.RecyclerView.t(Unknown Source) 
at android.support.v7.widget.RecyclerView.c(Unknown Source) 
at android.support.v7.widget.eg.run(Unknown Source) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
at android.view.Choreographer.doFrame(Choreographer.java:603) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:152) 
at android.app.ActivityThread.main(ActivityThread.java:5507) 
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) 
CoOpStatusHolder is my FirebaseUI RecyclerView Viewholder. I made the Viewholder an inner class. I made it public static and it's in proguard-rules.pro file, so I'm still not sure what the issue is...
public static class CoOpStatusHolder extends RecyclerView.ViewHolder {
View mView;
public CoOpStatusHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setName(String name) {
TextView nameOfParentToChoose = (TextView) mView.findViewById(R.id.
textView_of_parent_name_in_co_op_status);
nameOfParentToChoose.setText(name);
}
public void setFacebookImage(String facebookID) {
ProfilePictureView parentFacebookPhoto = (ProfilePictureView) mView.findViewById(R.id.
imageview_of_parent_in_co_op_status);
parentFacebookPhoto.setProfileId(facebookID);
}
public void setHours(Float numofHours) {
TextView numOfHoursForParent = (TextView) mView.findViewById(R.id.
textView_num_of_hours_in_co_op_other_parent_status);
numOfHoursForParent.setText(Float.toString(numofHours));
}
}

Android Firebase Database Exception while runTransaction

I am using TransactionHandler to push a data object as there can be concurrency issues. but while doing that I am getting the below exception:
09-15 19:12:20.193 3196-3196/com.teja.twaters D/com.teja.twaters.utils.FirebaseUtil: isComplete - false
09-15 19:12:20.207 3196-3196/com.teja.twaters D/com.teja.twaters.utils.FirebaseUtil: databaseError - DatabaseError: User code called from the Firebase Database runloop threw an exception:
java.lang.StackOverflowError: stack size 1037KB
at java.lang.reflect.Method.invoke(Native Method)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(Unknown Source)
at com.google.android.gms.internal.zzaln.zzbw(Unknown Source)
at com.google.android.gms.internal.zzaln.zzcd(Unknown Source)
at com.google.android.gms.internal.zzaln$zza.zzce(
I did search for this exception during runTransaction, but couldn't find any. Below is the code snippet where I get this exception:
dataSnapshot.getRef().runTransaction(new Transaction.Handler() {
#Override
public Transaction.Result doTransaction(MutableData mutableData) {
mutableData.child(order.getId() + "").setValue(order);
return Transaction.success(mutableData);
}

#Override
public void onComplete(DatabaseError databaseError, boolean isComplete, DataSnapshot dataSnapshot) {
logger.debug("isComplete - " + isComplete);
if(isComplete){
logger.debug("dataSnapshot - " + dataSnapshot);
callback.onSuccess(IConstants.USER_ORDER_SAVED);
} else {
logger.debug("databaseError - " + databaseError);
callback.onSuccess(IConstants.USER_ORDER_SAVE_FAILED);
}
}

});
I get this only with runTransaction. But setValue for a child and updateChildren are working good. Someone else faced with this scenario?
UPDATE:
The root cause i found is that, the Order POJO I was using has a sub-class which was not declared as static. I changed that, and everything is working as expected.
The appearance of dataSnapshot.getRef() in the code you posted is a clue that the code is running inside a listener callback. Let's say the listener is on location X. When you call dataSnapshot.getRef().runTransaction(), you are requesting the transaction on the value at location X. That value is the MutableData you get in the doTransaction() callback. In the doTransaction() callback, you are setting the value of a child of X, which is also a change to X itself. This causes the listener to fire again. I suspect that is the loop that is causing the stack overflow.
Also, this answer provides the details of how transactions are performed. It might be helpful.
For further readers... I had the problem that I had a method inside of my
POJO called getDBReference(), which was not static and returned the
DatabaseReference
to this POJO instance. Which, then in a transaction was falsely detected by reflection to "add" to the transaction and caused a StackOverFlow.
tl;dr
I forgot to annotate this method with #Exclude, that was the problem.
This occurs if u call FirebaseDatabase.getInstance() at several place . You should create a singleton instance of it and then use it throught out your project .
Example :
public class FirebaseUtils{
private static FirebaseDatabase mDatabase;
public static FirebaseDatabase getDatabase() {
if (mDatabase == null) {
mDatabase = FirebaseDatabase.getInstance();
}
return mDatabase;
} }
and get the database FirebaseUtils.getDatabase();

FirebaseAnalytics logEvent() causes OOM

I'm tracking how the user is navigating inside my application with Firebase like so:
43. FirebaseAnalytics mTracker = MyApplication.getDefaultTracker();
44. Bundle payload = new Bundle();
45. payload.putString(FirebaseAnalytics.Param.VALUE, "page");
46. mTracker.logEvent("Navigation", payload);
And once in a while I get OOM Exception with this stack trace:
Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:1063)
at com.google.android.gms.measurement.internal.zzw.zzd(Unknown Source)
at com.google.android.gms.measurement.internal.zzw.zzd(Unknown Source)
at com.google.android.gms.measurement.internal.zzac.zzay(Unknown Source)
at com.google.android.gms.measurement.internal.zzac.zzay(Unknown Source)
at com.google.android.gms.measurement.internal.zzac.zzay(Unknown Source)
at com.google.android.gms.measurement.AppMeasurement.logEvent(Unknown Source)
at com.google.firebase.analytics.FirebaseAnalytics.getInstance(Unknown Source)
at com.a.b.c.trackNavigation(SoudfaTracker.java:46)
at com.a.b.c.ProfileFragment.init(ProfileFragment.java:167)
at com.a.b.c.ProfileFragment_.onViewChanged(ProfileFragment_.java:190)
at org.androidannotations.api.view.OnViewChangedNotifier.notifyViewChanged(OnViewChangedNotifier.java:41)
at com.soudfa.Fragments.Profile.ProfileFragment_.onViewCreated(ProfileFragment_.java:104)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
I'm running compile 'com.google.firebase:firebase-analytics:9.0.2'
Has anyone tried this?

Unable to start activity ComponentInfo{com.viralandroid.test/com.paypal.android.sdk.payments.PaymentActivity}:

How could I solve the problem below? I searched a lot but I didn't figure out.
I am using a fragment instead of an activity to call PaymentActivity.
Thanks in advance.
There is a piece of code below.
public void executarPagtoPayPal()
{
SearchResultsAdapter searchResultsAdapter = new SearchResultsAdapter(getActivity(), new ArrayList<Produto>());
PayPalPayment coisasAComprar = searchResultsAdapter.prepararCarrinhoFinal();
Intent i = new Intent(getActivity(), PaymentActivity.class);
i.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, payPalConfiguration);
i.putExtra(PaymentActivity.EXTRA_PAYMENT, coisasAComprar);
startActivityForResult(i,CODIGO_PAGTO);
}
06-01 13:26:31.841 12770-12770/com.viralandroid.test E/Parcel: Class not found when unmarshalling:
java.lang.ClassNotFoundException: Invalid name:
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at com.paypal.android.sdk.payments.PayPalPayment.(Unknown Source)
at com.paypal.android.sdk.payments.PayPalPayment.(Unknown Source)
at com.paypal.android.sdk.payments.br.createFromParcel(Unknown Source)
at android.os.Parcel.readParcelable(Parcel.java:2252)
at android.os.Parcel.readValue(Parcel.java:2152)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.containsKey(BaseBundle.java:269)
at android.content.Intent.hasExtra(Intent.java:5055)
at com.paypal.android.sdk.payments.d.b(Unknown Source)
at com.paypal.android.sdk.payments.PaymentActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
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:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
06-01 13:26:31.841 12770-12770/com.viralandroid.test D/AndroidRuntime: Shutting down VM
06-01 13:26:31.841 12770-12770/com.viralandroid.test E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.viralandroid.test, PID: 12770
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.viralandroid.test/com.paypal.android.sdk.payments.PaymentActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling:
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
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:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling:
at android.os.Parcel.readParcelableCreator(Parcel.java:2295)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at com.paypal.android.sdk.payments.PayPalPayment.(Unknown Source)
at com.paypal.android.sdk.payments.PayPalPayment.(Unknown Source)
at com.paypal.android.sdk.payments.br.createFromParcel(Unknown Source)
at android.os.Parcel.readParcelable(Parcel.java:2252)
at android.os.Parcel.readValue(Parcel.java:2152)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.containsKey(BaseBundle.java:269)
at android.content.Intent.hasExtra(Intent.java:5055)
at com.paypal.android.sdk.payments.d.b(Unknown Source)
at com.paypal.android.sdk.payments.PaymentActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) 
at android.app.ActivityThread.access$900(ActivityThread.java:177) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5910) 
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:1405) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 
It looks like the contents of the PayPalPayment that you are putting in the Intent are not correct. Please validate that this object has all the correct data.

Categories

Resources