Google Sign in not working after migrating to AndroidX
I have integrated Google Sign in my android app. It was working perfectly when I used spp compact v28 libraries but it is failing after mygrating my app to androidx with the below exception.
java.lang.IncompatibleClassChangeError: Class 'com.google.android.gms.auth.api.signin.internal.SignInHubActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/com.grecloud-2/split_lib_dependencies_apk.apk:classes89.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzn(Unknown Source)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onActivityResult(Unknown Source)
at android.app.Activity.dispatchActivityResult(Activity.java:6500)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3936)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3983)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
The activity that has code for Google Sign In extends AppCompatActivity and implements GoogleApiClient.OnConnectionFailedListener, View.OnClickListener
add a comment |
I have integrated Google Sign in my android app. It was working perfectly when I used spp compact v28 libraries but it is failing after mygrating my app to androidx with the below exception.
java.lang.IncompatibleClassChangeError: Class 'com.google.android.gms.auth.api.signin.internal.SignInHubActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/com.grecloud-2/split_lib_dependencies_apk.apk:classes89.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzn(Unknown Source)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onActivityResult(Unknown Source)
at android.app.Activity.dispatchActivityResult(Activity.java:6500)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3936)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3983)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
The activity that has code for Google Sign In extends AppCompatActivity and implements GoogleApiClient.OnConnectionFailedListener, View.OnClickListener
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05
add a comment |
I have integrated Google Sign in my android app. It was working perfectly when I used spp compact v28 libraries but it is failing after mygrating my app to androidx with the below exception.
java.lang.IncompatibleClassChangeError: Class 'com.google.android.gms.auth.api.signin.internal.SignInHubActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/com.grecloud-2/split_lib_dependencies_apk.apk:classes89.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzn(Unknown Source)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onActivityResult(Unknown Source)
at android.app.Activity.dispatchActivityResult(Activity.java:6500)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3936)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3983)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
The activity that has code for Google Sign In extends AppCompatActivity and implements GoogleApiClient.OnConnectionFailedListener, View.OnClickListener
I have integrated Google Sign in my android app. It was working perfectly when I used spp compact v28 libraries but it is failing after mygrating my app to androidx with the below exception.
java.lang.IncompatibleClassChangeError: Class 'com.google.android.gms.auth.api.signin.internal.SignInHubActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/com.grecloud-2/split_lib_dependencies_apk.apk:classes89.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzn(Unknown Source)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onActivityResult(Unknown Source)
at android.app.Activity.dispatchActivityResult(Activity.java:6500)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3936)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3983)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
The activity that has code for Google Sign In extends AppCompatActivity and implements GoogleApiClient.OnConnectionFailedListener, View.OnClickListener
asked Nov 21 '18 at 16:43
Krishan DadlaniKrishan Dadlani
262
262
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05
add a comment |
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05
add a comment |
1 Answer
1
active
oldest
votes
After removing the following 2 lines in build.gradle it is working for me:
implementation "androidx.media:media:1.1.0-alpha01"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416807%2fgoogle-sign-in-not-working-after-migrating-to-androidx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
After removing the following 2 lines in build.gradle it is working for me:
implementation "androidx.media:media:1.1.0-alpha01"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
add a comment |
After removing the following 2 lines in build.gradle it is working for me:
implementation "androidx.media:media:1.1.0-alpha01"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
add a comment |
After removing the following 2 lines in build.gradle it is working for me:
implementation "androidx.media:media:1.1.0-alpha01"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
After removing the following 2 lines in build.gradle it is working for me:
implementation "androidx.media:media:1.1.0-alpha01"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
answered Jan 6 at 14:45
chrisonlinechrisonline
3,14992850
3,14992850
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
add a comment |
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
2
2
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
I noticed that when you use Android Studio’s Migrate option for AndroidX, strangely it updates the project but with alpha version of the libraries instead of using the production version. Changing the alpha libs to proper version as mentioned in the above comment worked for me.
– Krishan Dadlani
Jan 8 at 20:21
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416807%2fgoogle-sign-in-not-working-after-migrating-to-androidx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please add your activity code as well with the imports you are using.
– Nishant Dubey
Nov 21 '18 at 16:50
I'am having the same issue, following for this
– 4bottiglie
Dec 22 '18 at 21:31
Same issue. Any solution?
– chrisonline
Jan 6 at 13:47
Link to the Android bug that appears to be filed by the author. Note that there is a workaround in comment #7 that apparently works for some people (but not me). Also note that the issue is marked as blocked by another non-public issue so hopefully that means it is being addressed behind the scenes despite the lack of official response in the public bug. I recommend starring the Android bug to indicate interest in having it fixed (instead of adding a me too comment).
– rhashimoto
Jan 7 at 18:05