question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to update auth0Domain URL for android build

See original GitHub issue

❌ Describe the problem

Our app uses auth0 login widget to login users.

Currently, I’m unable to open Auth0 login widget with RN InAppBrowser once I clicked to login from the native app UI. Instead, I get an error like the screen attached below

This happens after checking the auth0Domain URL string from manifestPlaceholders array in build.gradle is indeed correct => I somwhow, at some point, accidentally pasted 3 chinese characters into the URL string BUT I corrected it afterwards. However my app still opens the URL with extra chinese characters at the end of it

❗❗❗ This only occurs in dev environment atm ❗❗❗

image

✅ What was the expected behavior?

I expect RN InAppBrowser opens the auth0 login widget using the correct URL that ends with .auth0.com (so that I can actually open the Auth0 login widget from InAppBrowser) rather than auth0.com.邓子豪

❌Current redirect URL: finishes with auth0.xn --com

✅ Expected redirect URL: finishes with auth0.com

👀 Reproduction

I am unable to reproduce it on any of my coworkers machine except for mine, and this issue happens on both the android VD and well as my physical samsung device, so I suspect the problem is DEFINITELY in the android build process, not my local android environment setup

📝 Things I’ve tried so far to solve it:

  1. Deleted /android/.gradle folder
  2. Deleted /android/build folder
  3. Cleaned android cache by cd android then gradlew clean as well as gradlew cleanBuildCache => I looked up that gradlew clean and gradlew cleanBuildCache are obsolete according to this stackoverflow page, so I followed the latest methods to clean cache
  4. Cleaned yarn cache by yarn cache clean
  5. Clearned watchman by running watchman watch-del-all
  6. Wiped emulator data for all VDs
  7. Re-created VDs and ran the app
  8. Deleted and reintalled node_modules
  9. Cleared the browser cache for all browsers on all virtual devices that the app (seems useless becos RN uses InAppBrowser rather than browsers on your VDs)
  10. Cleared the cahce for the app on my VD - I cleared both data storage PLUS the cache
  11. Intentionally made manifestPlaceholders = [auth0Domain: "our-own.auth0.com", auth0Scheme: "${applicationId}"] to manifestPlaceholders = [auth0Domain: "jibberish.auth0.com", auth0Scheme: "${applicationId}"] to see if the auth0 URL changes after build, which is didn’t. The VD still opens the wrong auth0 URL (the one that has extra chinese characters at the end of it - see screenshot)
  12. Reinstalled our InAppBrowser (react-native-inappbrowser-reborn)

Environment

NPM packages related:

  1. "react-native-auth0": "^2.13.1"
  2. "react-native": "0.65.1"

Android stuff:

buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
androidXAnnotation = "1.2.0"
androidXBrowser = "1.3.0"

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tyfrthcommented, Jun 8, 2022

Similar to what @Mingyang-Li has stated regarding other machines, just adding that I wasn’t able to reproduce this in our sample app on my end either 🤔

1reaction
juddeycommented, Jun 7, 2022

What happens when you run a release build?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auth0 Android SDK Quickstarts: Login
This quickstart demonstrates how to add user login to an Android application using Auth0.
Read more >
Auth0.Android
First, go to Dashboard > Applications and click the name of the application you want to edit. In Allowed Callback URLs, make sure...
Read more >
Custom Domains - Auth0
The custom domain in Auth0 is like a "mask" for your tenant domain URL. You can configure your custom domain when you create...
Read more >
How do we support multiple auth0 domains on Android in a ...
Open your app's build.gradle file (typically at android/app/build.gradle ) and add the following manifest placeholders. The value for ...
Read more >
Auth0 Android SDK Quickstarts: Add Login to your Android App
This quickstart demonstrates how to add user login to an Android application using Auth0. ... You must set Auth0 tenant domain and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found