-
Notifications
You must be signed in to change notification settings - Fork 242
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
java.lang.RuntimeException: Unable to start activity ComponentInfo #362
Comments
I suspect it's the same issue raised on the Android SDK itself at openid/AppAuth-Android#406. Although the stack trace doesn't seem to indicate that it's not found and looks like a different issue altogether. If you have a way to reproduce it without this plugin then I'd suggest to file an issue on the repo for the Android SDK as it looks like an issue with the SDK |
Happens to me as well. Tested it with various emulators and physical devices running different android SDKs, but the result remains unfortunately the same.
|
@urbanjagodic I found a workaround to make it work again - however, I'm not yet sure if that is a proper solution to the problem. In my case I had to add That looks as follows:
|
@lauroboeni Thanks for the workaround, unfortunately i haven't found any proper solution to this issue, if it's SDK correlated than we will just have to wait for an update. |
Do either of you have this issue running the example app? If not, can you create a repo that hosts a minimal app that can reproduce the issue |
@lauroboeni Does the workaround still work for you? Flutter does not ship with an AppTheme style by default. Do you have an example for me? I'm running into the same issue. |
@mattheuten The workaround still works in my case, yes. However, I also found out that apparently some specific versions of More precise, my
When downgrading (and fixing) the |
@MaikuB the example app itself works fine on my side. However, if I add
to
If I add
the app starts perfectly fine. So it really seems that these package versions are somehow not compatible. |
@lauroboeni yep it would seem that way. My educated guess based on those logs is to do with conflicting AndroidX dependencies. These aren't explicitly specified by this plugin so could be to do with what's specified by the AppAuth Android SDK, your own app and/or the |
Hello, @MaikuB would you consider a PR if we prepare it? Thanks and keep up the good work! |
@micmar sure, open one and I'll review it |
@micmar would you be able to elaborate on what makes you think that is the cause of the issue? The logs @lauroboeni shared points to conflicting dependencies so ordinarily I wouldn't think that switching the Android API used would fix something like this |
@MaikuB Now in FlutterAppauthPlugin.java, deprecated APIs are used at lines: Apparently one should use registerForActivtyResult instead to get a launcher, that can be used to launch an intent. Everything is explained very well in here: https://tedblob.com/fragment-startactivityforresult-is-deprecated/ Hope it helps. PS: allow me to apologise as so far I did not have time to try it... |
we've traced this issue in our app to the local_auth library and I've raised a bug there (flutter/flutter#113208). @MaikuB I don't understand enough about what happens when packages are built to understand what might be happening here, or whether it helps narrow down the why? |
@micmar if that were the cause then it should cause a problem for more versions of local_auth. However, if you look at what @lauroboeni shared, this problem occurs when local_auth_android 1.0.9+ is pulled. With 1.0.8, it's fine. The difference between these two is local_auth_android bumped an AndroidX library dependency. This should lend more credence to it being a dependency conflict and not to do with use of older APIs. I would suggest those experiencing the issue look into how dependency resolution works on Android and try overriding it. Googling the error may help provide some solutions. Note that from the plugin's side, the only Android dependency it explicitly pulls in is the AppAuth Android SDK so anything else like AndroidX is transitive via the SDK. This means there isn't a fix for the plugin side. and libraries like this plugin shouldn't be trying to specify dependency overrides |
@MaikuB when you say trying to overriding the android dependency do you mean trying to get 'our' app AppAuth to use the older AndroidX dependency? Also, could this be addressed by updating the AndroidX dependency in flutter_appauth. (Apologies if these seem obvious, I'm very fresh to flutter development) |
i try you solution but obtain exception: ".....style/AppTheme) not found." |
Hi @micmar Where you able to migrate the depreciated code and try it out ? |
Was updating my app and ran into this problem. Works with following settings ( Thanks @lauroboeni !) :
When looking into the changelog of local_auth_android (https://pub.dev/packages/local_auth_android/changelog), it seems to be incompatible since they've upgraded androidx.fragment to 1.5.1. |
Also started to run into this issue recently. I am pretty surprised at the proposed solutions tbh. We are not using The relevant parts of the logs are:
This means that for some reason the I am still scratching my head to what changed for us, as the plugin did work recently. The only potential issue I see is that the plugin uses the base So my last guess so far would be that there might be sort of erasure as only the superclass Anyway regarding the proposed fixes, imo this is the way: In your manifest overwrite the redirect activity with an appropriate appcompat theme.
And on a personal note, I do think this is an issue in the plugin even if I can not pinpoint it yet. Maybe it would help to also update the example app to some up2date version of flutter. |
This issue happen to me in version flutter_appauth: ^6.0.2. |
That's works for me also |
I'm facing some issues with the latest version of the package (
flutter_appauth: 4.2.0
):It seems like some activity for
RedirectUriReceiverActivity
is missing / cannot be found - anyone with the same issue or any idea for the reason?LOGS:
The text was updated successfully, but these errors were encountered: