yangxvlin / Family-Artifact-Register

COMP30022 - IT Project - 2019S2 - Capstone Project
GNU General Public License v3.0
3 stars 1 forks source link

error when new user sign up #161

Closed yangxvlin closed 5 years ago

yangxvlin commented 5 years ago

159

click email in main activity sign up with new email but not navigated to CollectUserInfoActivity

In FamilyArtifactRegisterActivity

    @Override
    public void callback(int requestCode, int resultCode, Void data) {
        if (requestCode == CHECK_USER_DB) {
            switch (resultCode) {
                case (FirebaseAuthHelper.RESULT_USER_EXIST):
//                     Toast.makeText(this, R.string.user_signed_in, Toast.LENGTH_SHORT).show();
                    Toasty.info(this, R.string.user_signed_in, Toasty.LENGTH_LONG)
                            .show();
                     startHomeActivity();
//                    startCollectUserInfoActivity();
                    break;
                case (FirebaseAuthHelper.RESULT_NEW_USER):
                    // Toast.makeText(this, R.string.registeration_successful,
                    //        Toast.LENGTH_SHORT).show();
                    Toasty.success(this, R.string.registeration_successful, Toasty.LENGTH_LONG)
                            .show();
                    startCollectUserInfoActivity();
                    break;
            }
        }
    }
D/FirebaseAuthHelper: No such user info, adding to db
E/UserInfoManager: get failed: current user does not exist: UIzPCZDFueb3lfmQ1tLZqMilLwm1
E/ArtifactManager: getArtifactByUid failed: null
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
E/ArtifactManager: getArtifactByUid failed: null
D/UserInfoManager: User informationuid: UIzPCZDFueb3lfmQ1tLZqMilLwm1, displayName: null, email: 111@qq.com, phoneNumber: null, photoUrl: null, friendUids: {}, artifactItemIds: {}, artifactTimelineIds: {}successfully written!
V/FA: Inactivity, disconnecting from the service
yangxvlin commented 5 years ago

@Dovermore

when click confirm following error ocurs

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.family_artifact_register, PID: 17545
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.family_artifact_register/com.example.family_artifact_register.HomeActivity}: java.lang.IllegalArgumentException: Value already present: /data/user/0/com.example.family_artifact_register/cache/2019100918292ba77184-c276-41e0-a4e5-1eb38b6af1a2.png
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2844)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2922)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6618)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
     Caused by: java.lang.IllegalArgumentException: Value already present: /data/user/0/com.example.family_artifact_register/cache/2019100918292ba77184-c276-41e0-a4e5-1eb38b6af1a2.png
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:216)
        at com.google.common.collect.HashBiMap.put(HashBiMap.java:280)
        at com.google.common.collect.HashBiMap.put(HashBiMap.java:256)
        at com.example.family_artifact_register.FoundationLayer.Util.FirebaseStorageHelper.loadByRemoteUri(FirebaseStorageHelper.java:120)
        at com.example.family_artifact_register.PresentationLayer.SocialPresenter.ContactViewModel$1$2.onChanged(ContactViewModel.java:79)
        at com.example.family_artifact_register.PresentationLayer.SocialPresenter.ContactViewModel$1$2.onChanged(ContactViewModel.java:68)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:144)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:442)
        at androidx.lifecycle.LiveData.observeForever(LiveData.java:232)
        at androidx.lifecycle.MediatorLiveData$Source.plug(MediatorLiveData.java:141)
        at androidx.lifecycle.MediatorLiveData.onActive(MediatorLiveData.java:118)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:436)
        at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:394)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361)
        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:300)
        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:339)
        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:145)
        at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:131)
        at androidx.fragment.app.Fragment.performStart(Fragment.java:2637)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:915)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStart(FragmentManagerImpl.java:2619)
        at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:257)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:551)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
        at com.example.family_artifact_register.HomeActivity.onStart(HomeActivity.java:119)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1335)
        at android.app.Activity.performStart(Activity.java:7043)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2807)
            ... 9 more
I/Process: Sending signal. PID: 17545 SIG: 9
Process 17545 terminated.
Dovermore commented 5 years ago

RU trying to set image?

Dovermore commented 5 years ago

159

click email in main activity sign up with new email but not navigated to CollectUserInfoActivity

In FamilyArtifactRegisterActivity

    @Override
    public void callback(int requestCode, int resultCode, Void data) {
        if (requestCode == CHECK_USER_DB) {
            switch (resultCode) {
                case (FirebaseAuthHelper.RESULT_USER_EXIST):
//                     Toast.makeText(this, R.string.user_signed_in, Toast.LENGTH_SHORT).show();
                    Toasty.info(this, R.string.user_signed_in, Toasty.LENGTH_LONG)
                            .show();
                     startHomeActivity();
//                    startCollectUserInfoActivity();
                    break;
                case (FirebaseAuthHelper.RESULT_NEW_USER):
                    // Toast.makeText(this, R.string.registeration_successful,
                    //        Toast.LENGTH_SHORT).show();
                    Toasty.success(this, R.string.registeration_successful, Toasty.LENGTH_LONG)
                            .show();
                    startCollectUserInfoActivity();
                    break;
            }
        }
    }
D/FirebaseAuthHelper: No such user info, adding to db
E/UserInfoManager: get failed: current user does not exist: UIzPCZDFueb3lfmQ1tLZqMilLwm1
E/ArtifactManager: getArtifactByUid failed: null
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
E/ArtifactManager: getArtifactByUid failed: null
D/UserInfoManager: User informationuid: UIzPCZDFueb3lfmQ1tLZqMilLwm1, displayName: null, email: 111@qq.com, phoneNumber: null, photoUrl: null, friendUids: {}, artifactItemIds: {}, artifactTimelineIds: {}successfully written!
V/FA: Inactivity, disconnecting from the service

This is addressed in the newest commit b5632df

Dovermore commented 5 years ago

@Dovermore

when click confirm following error ocurs

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.family_artifact_register, PID: 17545
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.family_artifact_register/com.example.family_artifact_register.HomeActivity}: java.lang.IllegalArgumentException: Value already present: /data/user/0/com.example.family_artifact_register/cache/2019100918292ba77184-c276-41e0-a4e5-1eb38b6af1a2.png
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2844)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2922)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6618)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
     Caused by: java.lang.IllegalArgumentException: Value already present: /data/user/0/com.example.family_artifact_register/cache/2019100918292ba77184-c276-41e0-a4e5-1eb38b6af1a2.png
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:216)
        at com.google.common.collect.HashBiMap.put(HashBiMap.java:280)
        at com.google.common.collect.HashBiMap.put(HashBiMap.java:256)
        at com.example.family_artifact_register.FoundationLayer.Util.FirebaseStorageHelper.loadByRemoteUri(FirebaseStorageHelper.java:120)
        at com.example.family_artifact_register.PresentationLayer.SocialPresenter.ContactViewModel$1$2.onChanged(ContactViewModel.java:79)
        at com.example.family_artifact_register.PresentationLayer.SocialPresenter.ContactViewModel$1$2.onChanged(ContactViewModel.java:68)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:144)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:442)
        at androidx.lifecycle.LiveData.observeForever(LiveData.java:232)
        at androidx.lifecycle.MediatorLiveData$Source.plug(MediatorLiveData.java:141)
        at androidx.lifecycle.MediatorLiveData.onActive(MediatorLiveData.java:118)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:436)
        at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:394)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361)
        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:300)
        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:339)
        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:145)
        at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:131)
        at androidx.fragment.app.Fragment.performStart(Fragment.java:2637)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:915)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStart(FragmentManagerImpl.java:2619)
        at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:257)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:551)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
        at com.example.family_artifact_register.HomeActivity.onStart(HomeActivity.java:119)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1335)
        at android.app.Activity.performStart(Activity.java:7043)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2807)
          ... 9 more
I/Process: Sending signal. PID: 17545 SIG: 9
Process 17545 terminated.

Can you provide log for this?