Closed NoshinDev closed 1 year ago
The screenshot would seem to indicate you are using an Android emulator that hasn't been properly configured or an outdated device. This is based on how the screenshot shows an webview being opened instead of Chrome Custom tab and webviews aren't supported by the native AppAuth SDKs. You'll need to use an up to date device or use a properly configured emulator. From memory, the emulator needs to be one with Google Play services enabled
The screenshot would seem to indicate you are using an Android emulator that hasn't been properly configured or an outdated device. This is based on how the screenshot shows an webview being opened instead of Chrome Custom tab and webviews aren't supported by the native AppAuth SDKs. You'll need to use an up to date device or use a properly configured emulator. From memory, the emulator needs to be one with Google Play services enabled
This also happens on real devices tested on android 12
E/AndroidRuntime(28156): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) E/AndroidRuntime(28156): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034) E/AndroidRuntime(28156): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:846) E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809) E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatDelegateImpl.initWindowDecorActionBar(AppCompatDelegateImpl.java:550) E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatDelegateImpl.getSupportActionBar(AppCompatDelegateImpl.java:537) E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatDelegateImpl.invalidateOptionsMenu(AppCompatDelegateImpl.java:1220) E/AndroidRuntime(28156): at androidx.appcompat.app.AppCompatActivity.invalidateOptionsMenu(AppCompatActivity.java:314) E/AndroidRuntime(28156): at androidx.activity.ComponentActivity.invalidateMenu(ComponentActivity.java:553) E/AndroidRuntime(28156): at androidx.activity.ComponentActivity$$ExternalSyntheticLambda2.run(Unknown Source:2) E/AndroidRuntime(28156): at androidx.core.view.MenuHostHelper.addMenuProvider(MenuHostHelper.java:133) E/AndroidRuntime(28156): at androidx.activity.ComponentActivity.addMenuProvider(ComponentActivity.java:531) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentActivity$HostCallbacks.addMenuProvider(FragmentActivity.java:736) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentManager.attachController(FragmentManager.java:2784) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentController.attachHost(FragmentController.java:117) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentActivity.lambda$init$3$androidx-fragment-app-FragmentActivity(FragmentActivity.java:140) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentActivity$$ExternalSyntheticLambda0.onContextAvailable(Unknown Source:2) E/AndroidRuntime(28156): at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99) E/AndroidRuntime(28156): at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:352) E/AndroidRuntime(28156): at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:217) E/AndroidRuntime(28156): at net.openid.appauth.RedirectUriReceiverActivity.onCreate(RedirectUriReceiverActivity.java:49) E/AndroidRuntime(28156): at android.app.Activity.performCreate(Activity.java:8145) E/AndroidRuntime(28156): at android.app.Activity.performCreate(Activity.java:8125) E/AndroidRuntime(28156): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1344) E/AndroidRuntime(28156): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3750) E/AndroidRuntime(28156): ... 12 more I/Process (28156): Sending signal. PID: 28156 SIG: 9 Lost connection to device.
In that case this one looks like a different issue and the trace is same as what got raised in https://github.com/MaikuB/flutter_appauth/issues/362 so will close this as a duplicate. From what I know, what's happening is outside the control of this plugin. You may need to see what workarounds others have used in that issue
I tried to add app_auth authorization to this basic project: https://github.com/fluttercommunity/flutter_downloader/blob/master/example/lib/main.dart
But after creating an authorization page and an authorization button redirecting to the web for data entry, the application crashes and loses connection to the project. If you skip the authorization and try to download the file there will be no problem, but if you erase all the implementations of flutter_downloader except the file
pubscpec.yaml
the result will be the crash of the applicationMy
pubspec.yaml
file looks as follows:Authorization file: