{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/Lock.Android/issues/331","repository_url":"https://api.github.com/repos/auth0/Lock.Android","labels_url":"https://api.github.com/repos/auth0/Lock.Android/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/auth0/Lock.Android/issues/331/comments","events_url":"https://api.github.com/repos/auth0/Lock.Android/issues/331/events","html_url":"https://github.com/auth0/Lock.Android/issues/331","id":172002819,"number":331,"title":"IllegalStateException in GoogleIdentityProvider.onPermissionsRequireExplanation","user":{"login":"pmq","id":516479,"avatar_url":"https://avatars.githubusercontent.com/u/516479?v=3","gravatar_id":"","url":"https://api.github.com/users/pmq","html_url":"https://github.com/pmq","followers_url":"https://api.github.com/users/pmq/followers","following_url":"https://api.github.com/users/pmq/following{/other_user}","gists_url":"https://api.github.com/users/pmq/gists{/gist_id}","starred_url":"https://api.github.com/users/pmq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmq/subscriptions","organizations_url":"https://api.github.com/users/pmq/orgs","repos_url":"https://api.github.com/users/pmq/repos","events_url":"https://api.github.com/users/pmq/events{/privacy}","received_events_url":"https://api.github.com/users/pmq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-18T21:15:21Z","updated_at":"2016-08-26T20:26:58Z","closed_at":null,"body":"Hi,\r\n\r\nWe upgraded to 1.17.0 and are having a major problem with the native Google authentication. We thought we were using the textbook integration :\r\n\r\n```\r\n// setup Auth0 and the native Google integration\r\nParameterBuilder paramsBuilder = ParameterBuilder.newBuilder();\r\nString scope = ParameterBuilder.SCOPE_OFFLINE_ACCESS + \" email\";\r\nMap<String, Object> parameters = paramsBuilder.setScope(scope).asDictionary();\r\n\r\nLockContext.configureLock(\r\n        new Lock.Builder()\r\n                .loadFromApplication(this)\r\n                .withIdentityProvider(Strategies.GooglePlus, new GoogleIdentityProvider(this))\r\n                .authenticationParameters(parameters)\r\n);\r\n```\r\n\r\nWhen a user uses the Google authentication button, the native integration correctly asks for permission to access the contacts, then if the user cancels that request, all future use of the Google auth button will crash the app with this stacktrace :\r\n\r\n```\r\n08-18 22:55:40.078 24786-24786/<REDACTED> E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                              Process: <REDACTED>, PID: 24786\r\n                                                              java.lang.RuntimeException: Could not dispatch event: class com.auth0.lock.event.IdentityProviderAuthenticationRequestEvent to handler [EventHandler public void com.auth0.lock.LockActivity.onIdentityProviderAuthentication(com.auth0.lock.event.IdentityProviderAuthenticationRequestEvent)]: You need to use a Theme.AppCompat theme (or descendant) with this activity.\r\n                                                                  at com.squareup.otto.Bus.throwRuntimeException(Bus.java:456)\r\n                                                                  at com.squareup.otto.Bus.dispatch(Bus.java:386)\r\n                                                                  at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:367)\r\n                                                                  at com.squareup.otto.Bus.post(Bus.java:336)\r\n                                                                  at com.auth0.lock.fragment.SmallSocialListFragment$1.onItemClick(SmallSocialListFragment.java:84)\r\n                                                                  at android.widget.AdapterView.performItemClick(AdapterView.java:310)\r\n                                                                  at android.widget.AbsListView.performItemClick(AbsListView.java:1145)\r\n                                                                  at android.widget.AbsListView$PerformClick.run(AbsListView.java:3066)\r\n                                                                  at android.widget.AbsListView$3.run(AbsListView.java:3903)\r\n                                                                  at android.os.Handler.handleCallback(Handler.java:739)\r\n                                                                  at android.os.Handler.dispatchMessage(Handler.java:95)\r\n                                                                  at android.os.Looper.loop(Looper.java:148)\r\n                                                                  at android.app.ActivityThread.main(ActivityThread.java:5417)\r\n                                                                  at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\n                                                               Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.\r\n                                                                  at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:343)\r\n                                                                  at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312)\r\n                                                                  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:277)\r\n                                                                  at android.support.v7.app.AppCompatDialog.setContentView(AppCompatDialog.java:80)\r\n                                                                  at android.support.v7.app.AlertController.installContent(AlertController.java:214)\r\n                                                                  at android.support.v7.app.AlertDialog.onCreate(AlertDialog.java:257)\r\n                                                                  at android.app.Dialog.dispatchOnCreate(Dialog.java:394)\r\n                                                                  at android.app.Dialog.show(Dialog.java:295)\r\n                                                                  at android.support.v7.app.AlertDialog$Builder.show(AlertDialog.java:953)\r\n                                                                  at com.auth0.google.GoogleIdentityProvider.onPermissionsRequireExplanation(GoogleIdentityProvider.java:97)\r\n                                                                  at com.auth0.identity.AuthorizedIdentityProvider.checkPermissions(AuthorizedIdentityProvider.java:156)\r\n                                                                  at com.auth0.identity.AuthorizedIdentityProvider.start(AuthorizedIdentityProvider.java:72)\r\n                                                                  at com.auth0.lock.LockActivity.onIdentityProviderAuthentication(LockActivity.java:296)\r\n                                                                  at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                  at com.squareup.otto.EventHandler.handleEvent(EventHandler.java:89)\r\n                                                                  at com.squareup.otto.Bus.dispatch(Bus.java:384)\r\n                                                                  at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:367) \r\n                                                                  at com.squareup.otto.Bus.post(Bus.java:336) \r\n                                                                  at com.auth0.lock.fragment.SmallSocialListFragment$1.onItemClick(SmallSocialListFragment.java:84) \r\n                                                                  at android.widget.AdapterView.performItemClick(AdapterView.java:310) \r\n                                                                  at android.widget.AbsListView.performItemClick(AbsListView.java:1145) \r\n                                                                  at android.widget.AbsListView$PerformClick.run(AbsListView.java:3066) \r\n                                                                  at android.widget.AbsListView$3.run(AbsListView.java:3903) \r\n                                                                  at android.os.Handler.handleCallback(Handler.java:739) \r\n                                                                  at android.os.Handler.dispatchMessage(Handler.java:95) \r\n                                                                  at android.os.Looper.loop(Looper.java:148) \r\n                                                                  at android.app.ActivityThread.main(ActivityThread.java:5417) \r\n                                                                  at java.lang.reflect.Method.invoke(Native Method) \r\n                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) \r\n                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) \r\n```\r\n\r\nThis is on a Nexus 5, Android 6.0.1, in an app with these settings :\r\n\r\n```\r\nandroid {\r\n    compileSdkVersion 24\r\n    buildToolsVersion \"24.0.0\"\r\n\r\n    defaultConfig {\r\n        minSdkVersion 16\r\n        targetSdkVersion 23\r\n...\r\n```\r\n\r\nGradle : `2.14.1`\r\nAndroid Plugin : `com.android.tools.build:gradle:2.1.3`\r\n\r\nDebugging a little bit this issue, as the AppCompat dialog builder is using the context from the application, it's true that there is no theme. But the issue should not be there, as we got the code from the Auth0 sample code which also uses the application instance to build the `GoogleIdentityProvider`.\r\n\r\nHappy to provide more info if needed. Thanks."},"comment":{"url":"https://api.github.com/repos/auth0/Lock.Android/issues/comments/242842707","html_url":"https://github.com/auth0/Lock.Android/issues/331#issuecomment-242842707","issue_url":"https://api.github.com/repos/auth0/Lock.Android/issues/331","id":242842707,"user":{"login":"pmq","id":516479,"avatar_url":"https://avatars.githubusercontent.com/u/516479?v=3","gravatar_id":"","url":"https://api.github.com/users/pmq","html_url":"https://github.com/pmq","followers_url":"https://api.github.com/users/pmq/followers","following_url":"https://api.github.com/users/pmq/following{/other_user}","gists_url":"https://api.github.com/users/pmq/gists{/gist_id}","starred_url":"https://api.github.com/users/pmq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmq/subscriptions","organizations_url":"https://api.github.com/users/pmq/orgs","repos_url":"https://api.github.com/users/pmq/repos","events_url":"https://api.github.com/users/pmq/events{/privacy}","received_events_url":"https://api.github.com/users/pmq/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T20:26:58Z","updated_at":"2016-08-26T20:26:58Z","body":"@hzalaz any news? On my end I can repro very easily with the Lock.Android sample app. I just commented out the `useWebView` call and used the non-deprecated Google provider :\r\n\r\n```\r\n    @Override\r\n    public void onCreate() {\r\n        super.onCreate();\r\n\r\n        LockContext.configureLock(\r\n                new Lock.Builder()\r\n                        .loadFromApplication(this)\r\n                        .closable(true)\r\n                        .useEmail(true)\r\n                        .usePKCE(true)\r\n                        .fullscreen(false)\r\n                        // .useWebView(true)\r\n                        .withIdentityProvider(Strategies.Facebook, new FacebookIdentityProvider(this))\r\n                        .withIdentityProvider(Strategies.GooglePlus, new GoogleIdentityProvider(this))\r\n        );\r\n    }\r\n```\r\n\r\nAnd the sample app crashes with this exception :\r\n\r\n```\r\n08-26 22:20:31.480 7561-7561/com.auth0.app.Lock E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                                  Process: com.auth0.app.Lock, PID: 7561\r\n                                                                  java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=211, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.auth0.app.Lock/com.auth0.lock.LockActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.\r\n                                                                      at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)\r\n                                                                      at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)\r\n                                                                      at android.app.ActivityThread.-wrap16(ActivityThread.java)\r\n                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)\r\n                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)\r\n                                                                      at android.os.Looper.loop(Looper.java:148)\r\n                                                                      at android.app.ActivityThread.main(ActivityThread.java:5417)\r\n                                                                      at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\n                                                                   Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.\r\n                                                                      at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:310)\r\n                                                                      at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:279)\r\n                                                                      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:253)\r\n                                                                      at android.support.v7.app.AppCompatDialog.setContentView(AppCompatDialog.java:76)\r\n                                                                      at android.support.v7.app.AlertController.installContent(AlertController.java:213)\r\n                                                                      at android.support.v7.app.AlertDialog.onCreate(AlertDialog.java:240)\r\n                                                                      at android.app.Dialog.dispatchOnCreate(Dialog.java:394)\r\n                                                                      at android.app.Dialog.show(Dialog.java:295)\r\n                                                                      at android.support.v7.app.AlertDialog$Builder.show(AlertDialog.java:902)\r\n                                                                      at com.auth0.google.GoogleIdentityProvider.onPermissionsRequireExplanation(GoogleIdentityProvider.java:97)\r\n                                                                      at com.auth0.identity.AuthorizedIdentityProvider.onRequestPermissionsResult(AuthorizedIdentityProvider.java:143)\r\n                                                                      at com.auth0.lock.LockActivity.onRequestPermissionsResult(LockActivity.java:175)\r\n                                                                      at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6582)\r\n                                                                      at android.app.Activity.dispatchActivityResult(Activity.java:6460)\r\n                                                                      at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)\r\n                                                                      at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742) \r\n                                                                      at android.app.ActivityThread.-wrap16(ActivityThread.java) \r\n                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) \r\n                                                                      at android.os.Handler.dispatchMessage(Handler.java:102) \r\n                                                                      at android.os.Looper.loop(Looper.java:148) \r\n                                                                      at android.app.ActivityThread.main(ActivityThread.java:5417) \r\n                                                                      at java.lang.reflect.Method.invoke(Native Method) \r\n                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) \r\n                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) \r\n08-26 22:20:31.486 789-3056/? W/ActivityManager:   Force finishing activity com.auth0.app.Lock/com.auth0.lock.LockActivity\r\n```\r\n\r\nThis is a release blocker for us and probably for everyone using Lock.Android with target >= 23, any ETA on fixing this in a 1.17.1 release ?"}}
{"actor":{"display_login":"pmq"}}