When the support dependency is 25 or higher, Stormpath will crash when trying to launch a Chrome CustomTab. It works fine when the support dependency is between 23 and 24 (23.0.0 - 24.2.1). Here is the stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lithium.authproject, PID: 32035 java.lang.NoSuchMethodError: No static method startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V in class Landroid/support/v4/app/ActivityCompat; or its super classes (declaration of 'android.support.v4.app.ActivityCompat' appears in /data/data/com.lithium.authproject/files/instant-run/dex/slice-com.android.support-support-compat-25.1.0_28473661b71125eb02b3e2af329f0308e44fb2c0-classes.dex) at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:200) at com.stormpath.sdk.android.CustomTabActivityHelper.openCustomTab(CustomTabActivityHelper.java:60) at com.stormpath.sdk.SocialLoginManager.loginWithAccountStore(SocialLoginManager.java:53) at com.stormpath.sdk.SocialLoginManager$1.onSuccess(SocialLoginManager.java:30) at com.stormpath.sdk.SocialLoginManager$1.onSuccess(SocialLoginManager.java:25) at com.stormpath.sdk.ApiManager$OkHttpCallback$1.run(ApiManager.java:491) 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:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
I researched a little and it looks like as of support lib 25, CCT needs to work a little differently possibly due to packaging changes in the support deps. In this crash, ActivityCompat no longer has a public static method startActivity().
Here are two SO posts which may give some insight:
12
My project defines this line in gradle:
compile 'com.android.support:appcompat-v7:25.1.0'
When the support dependency is 25 or higher, Stormpath will crash when trying to launch a Chrome CustomTab. It works fine when the support dependency is between 23 and 24 (23.0.0 - 24.2.1). Here is the stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lithium.authproject, PID: 32035 java.lang.NoSuchMethodError: No static method startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V in class Landroid/support/v4/app/ActivityCompat; or its super classes (declaration of 'android.support.v4.app.ActivityCompat' appears in /data/data/com.lithium.authproject/files/instant-run/dex/slice-com.android.support-support-compat-25.1.0_28473661b71125eb02b3e2af329f0308e44fb2c0-classes.dex) at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:200) at com.stormpath.sdk.android.CustomTabActivityHelper.openCustomTab(CustomTabActivityHelper.java:60) at com.stormpath.sdk.SocialLoginManager.loginWithAccountStore(SocialLoginManager.java:53) at com.stormpath.sdk.SocialLoginManager$1.onSuccess(SocialLoginManager.java:30) at com.stormpath.sdk.SocialLoginManager$1.onSuccess(SocialLoginManager.java:25) at com.stormpath.sdk.ApiManager$OkHttpCallback$1.run(ApiManager.java:491) 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:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
I researched a little and it looks like as of support lib 25, CCT needs to work a little differently possibly due to packaging changes in the support deps. In this crash,
ActivityCompat
no longer has a public static methodstartActivity()
.Here are two SO posts which may give some insight: 1 2