Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Fragment: “Already managing a GoogleApiClient with id 0” #44

Open
dogeri28 opened this issue Dec 15, 2018 · 7 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@dogeri28
Copy link

Your library crashes when it the functionality is placed in a fragment. the solution is in this link below. you will need to override the onPause

https://stackoverflow.com/questions/36105118/error-in-fragment-already-managing-a-googleapiclient-with-id-0

@WindSekirun WindSekirun added the bug Something isn't working label Dec 16, 2018
@WindSekirun
Copy link
Owner

I implement RxSocialLogin.addLifecycleEvent(lifecycle: Lifecycle) and RxSocialLogin.removeLifecycleEvent(lifecycle: Lifecycle) methods in RxSocialLogin class.

These methods can (de)observe Lifecycle(androidx.lifecycle) event, execute lifecycle-related event automatically when lifecycle has changed in Activity and Fragment.

Just execute RxSocialLogin.addLifecycleEvent(getLifecycle()) in fragment will be fine.

If you don't use Lifecycle components, then you can call RxSocialLogin.getLoginModule(PlatformType.Google).onPauseEvent(). this method execute same thing.

Snapshot build wil availble in 20 minutes, please test and notice me.

@WindSekirun
Copy link
Owner

Snapshot : implementation 'com.github.WindSekirun:RxSocialLogin:48ce885917'

@dogeri28
Copy link
Author

Snapshot not building in my environment causes gradle to crash with

18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:23:5-72:19 to override.

@WindSekirun
Copy link
Owner

It seems you don't use androidx in your project.

Starting with the next release, i will be releasing only androidx, but i'll work with another branch and deploy a snapshot that does not use androidx.

@WindSekirun
Copy link
Owner

Snapshot: implementation 'com.github.WindSekirun:RxSocialLogin:373539f712'

@dogeri28
Copy link
Author

Thanks, i decided to use the normal google login and resolved the issue. i will still use yours but wanted to be sure i could address the issue

@WindSekirun
Copy link
Owner

WindSekirun commented Dec 17, 2018

I don't have much time to manage library until End of December, so I can't be sure I can resolve an issue at now.
If you can, please provide sample code to reproduce this issue? it can help when resolving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants