-
Notifications
You must be signed in to change notification settings - Fork 209
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
Could not invoke A0Auth.showUrl #67
Comments
having the same issue |
@jaga-me @VERSAYANA did you run react-native link react-native-auth0 as detailed in the README? |
@hzalaz Yes |
Same issue, working fine on IOS simulator, but getting this error on Android simulator. How can I help debug? |
Same here react-native: 0.43 |
Is this reproducible with our samples? |
@hzalaz can you point me at the sample to run? Some more data. From the android debug monitor, the error is this: Did the usual clean, invalidate caches, build, clean, etc.., and changed (oddly) to this: It does seem to be some kind of linking / build tools version error, but I don't see anything out of place. I'm using: |
You can download from https://auth0.com/docs/quickstart/native/react-native |
The sample works fine on the same simulator. |
Tried to make all the versions of packages / tools the same in the sample as in my app - still no crash in the simulator. @hzalaz , any ideas on how to proceed? |
yes getting the same issue |
@ronitslyper so Auth0 sample worked but in your app didn't? |
confirm the sample is working. the package in there is 1.0.1 |
Unless I can get a repo from you guys that can repro de issue there is little we can do |
@hzalaz Yes, the Auth0 sample worked but in my app didn't. I would be ok sharing my github repo with you. But I've got 9 linked libraries and 40+ npm dependencies - does someone ( @VERSAYANA @jaga-me ) have a more minimal example they could share with @hzalaz ? |
I've the same problem too. The error message is a little misleading in fact because the code where it crashes is this one: if (activity == null) {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(activity, Uri.parse(url));
} else {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
getReactApplicationContext().startActivity(intent);
} So we could think that the problem is in the second to last line In reality, if we invert the if condition, it kind of fixes the bug. Try replacing the lines above with: final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
getReactApplicationContext().startActivity(intent); and the bug is gone. I've found a stack overflow question that matches this same bugs here It suggests to bump the support SDK versions to 25.1.0 But as soon as you do this, you got a new error which this time leads to the real function which is launchUrl.
As referred here, this method is available only since API 25.0.0 so it could explain the problem (or not). Several SDK had this last bug too (Firebase, Spotify and others) After several tests, I didn't find a way to fix this other than the one above which skip the CustomTabsIntent all together Anyway, hope these information help solving this issue! |
@FredericRuaudel thanks for the info but I think there is something else in play here and I believe its one of the dependencies you added besides react-native-auth0 and to check that I really need a sample where you can repro de issue since I need to debug the dependencies to spot where two clash. Also ditching CustomTabsIntent is not something I'd do nor recommend since the experience is better than switching to the browser 😄 . @FredericRuaudel @VERSAYANA @jaga-me @ronitslyper @michaelspeed can you at least add to our sample the dependencies you added to your apps one by one till one breaks it? It should only be those that require linking. |
@hzalaz I tried doing that in order to create a minimal example with the bug, but couldn't manage to break it! Arrrrrgggh :) . May I share my repo with you? I'll put my contact info in the top-level README and we can continue from there. |
I finally got this working on android, by looking through all the linked-in libraries in my project, opening their build.gradle, and changing all versions of appcompat-v7 and customtabs to be the same, i.e. (gradle pointed in the right direction by warning about mismatches between the versions; I didn't notice these until I started opening the individual build.gradle's). |
Hi I also have this issue, and almost same as @ronitslyper 's method, I change build.gradle file, but instead of changing every linked-in libraries, I only change node_modules/react-native-auth0/android/build.gradle from
change to
and that's it, I open webauth page successfully, although I don't know why ~ lol |
I ran into this issue previously and concluded that it was due to the fact that To get around this without tweaking files in node_modules I updated the build.gradle in the root of my project to use the customtabs support library 25.0.1 whenever customtabs support library < 25 is being used I did this by adding the following to my build.gradle file
|
The @hhtu answer fixed it for me as well. I'll add a suggested pull request. |
This change fixes an issue several adopters are running into: "Could not invoke A0Auth.showUrl". See: auth0#67 (comment)
This change fixes an issue several adopters are running into: "Could not invoke A0Auth.showUrl". See: #67 (comment)
After implementing the @seanpatrickcatlin solution I started having the following problem:
|
I've tried @seanpatrickcatlin solution but it's not working for me. My
|
I've managed to solve it first checking the resolved dependencies in my project with And found out that // before
dependencies {
compile 'com.facebook.react:react-native:+'
compile "com.android.support:customtabs:${project.ext.buildToolsVersion}"
}
// after
dependencies {
compile 'com.facebook.react:react-native:+'
compile "com.android.support:customtabs:27.0.2"
} |
@mtt87 this fixed the problem for me as well! I'm using targetSdkVersion 27. Would be nice if we can make it work without tweaking files in |
I'm not an 💩Android 💩expert but maybe this could work, I'll try it in my project later
|
@mtt87 @LcTwisk This is a never ending issue... If any of your dependencies decides not to update the support version you'll have the same problem, and every new android version has it's own major version of supports libraries. Depending on what android version you are targeting with your app, you need to match that same major version on the support libraries. I don't know how to fix this and make everyone happy, if you have a suggestion that doesn't break everyone feel free to post it. |
@lbalmaceda I can't think about a solution that works for everyone tbh. Maybe as a little improvement we can add a section to the README with troubleshooting and mention this issue and copy and paste how to solve it from my post above? Otherwise let people use the search 😄 |
I also faced the same issue and managed to solve it by @seanpatrickcatlin solution. |
I am unclear which one of the above is the appropriate answer. None of them work for me. I keep getting the same issue. Is there a more permanent fix from Auth0? I am completely stuck now. Was working last week, now a dependancy has changed. This is the gradle for the Aut0 projecT: project.ext { buildscript {
} apply plugin: 'com.android.library' android {
} repositories { dependencies { |
What dependency has changed?? We haven't made any new releases for this SDK. If it was working a week before then the issue is not on this SDK. |
I followed the quick start for react-native.
Now I'm trying to show the login page with
auth0.webAuth .authorize({ scope: 'openid email', audience: 'https://ramtin.auth0.com/userinfo' }) .then(credentials => console.log(credentials)) .catch(error => console.log(error));
But I'm getting "Could not invoke A0Auth.showUrl" error
"react-native": "0.44.0",
"react-native-auth0": "^1.0.3",
The text was updated successfully, but these errors were encountered: