react-native-auth0
react-native-auth0 copied to clipboard
Issue when building native Android
Checklist
- [X] The issue can be reproduced in the react-native-auth0 sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Description
OS: Windows 10 Java 17 Gradle 7.3
I am currently trying to integrate react-native-auth0 to my Expo project.
My current dependencies are:
"dependencies": { "@expo/vector-icons": "^14.0.0", "@react-navigation/native": "^6.0.2", "expo": "~51.0.9", "expo-camera": "~15.0.10", "expo-constants": "~16.0.2", "expo-font": "~12.0.5", "expo-linking": "~6.3.1", "expo-modules-autolinking": "^1.11.1", "expo-router": "~3.5.14", "expo-splash-screen": "~0.27.4", "expo-status-bar": "~1.12.1", "expo-system-ui": "~3.0.4", "expo-web-browser": "~13.0.3", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.51.5", "react-native": "0.74.1", "react-native-auth0": "^3.2.1", "react-native-floating-action": "^1.22.0", "react-native-gesture-handler": "~2.16.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "4.10.1", "react-native-screens": "3.31.1", "react-native-web": "~0.19.10" }, "devDependencies": { "@babel/core": "^7.20.0", "@types/jest": "^29.5.12", "@types/react": "~18.2.45", "@types/react-test-renderer": "^18.0.7", "jest": "^29.2.1", "jest-expo": "~51.0.2", "react-test-renderer": "18.2.0", "typescript": "~5.3.3" },
I'm running Java 17 and Gradle 7.3 (which is what I need to use according to the compatibility matrix. The Auth0 library only runs with native code. So when trying to build the Android native code using the Expo builder, i.e. npx expo run:android, I keep getting this error:
`npx expo run:android env: load .env env: export EXPO_PUBLIC_AUTH0_DOMAIN EXPO_PUBLIC_AUTH0_CLIENT_ID › Building app... Picked up _JAVA_OPTIONS: -Xmx512M Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
-
Where: Script '
\node_modules\expo\scripts\autolinking.gradle' line: 4 -
What went wrong: A problem occurred evaluating script.
Could not find method exec() for arguments [autolinking_7wnwhgbtt7rc3qqznqll89fti$_run_closure1@46e55161] on object of type org.gradle.api.internal.provider.DefaultProviderFactory_Decorated.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 969ms
Error:
I get the same result when changing directory (cd) to the android folder and running gradle build.
This is the code in my expo\scripts\autolinking.gradle:
// Resolve expo>expo-modules-autolinkingdependency chain def autolinkingPath = ["node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })"] apply from: new File( providers.exec { workingDir(rootDir) commandLine(autolinkingPath) }.standardOutput.asText.get().trim(), "../scripts/android/autolinking_implementation.gradle" )
Reproduction
- Install react-native-auth0
- Follow the quick-start guide of react-native-auth0 integration with Expo
- Run
npx expo run:androidfrom root project orgradle buildfromandroidfolder
I'm not sure if this issue is reproducible for everyone. But it is consistently happening to me.
Additional context
I am testing all of this on both a physical and emulated version of a Pixel 7. Although I don't think it is related, as this is a build issue.
react-native-auth0 version
"react-native-auth0": "^3.2.1",
React Native version
"react-native": "0.74.1"
Expo version
"expo": "~51.0.9"
Platform
Android
Platform version(s)
14
For more context, this is the repository and branch I am working on https://github.com/lnaidu14/quickpay/tree/19-integrate-auth0
Bump
@lnaidu14 Now that we support bridgeless archtiecture in the latest version of the SDK, can you try again?
@lnaidu14 We are going to consider this fixed for now. Feel free to comment here and we can reopen this issue if the issue persists