The app its working very well on expo go but when I run npm run android I got this error everytime,
I’m using a IMAC with Catalina OS
› Building app…
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration on demand is an incubating feature.
(node:8207) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/apple/Documents/BPwebview/node_modules/@expo/devcert/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like “./”.
(Use node --trace-deprecation ...
to show where the warning was created)
(node:8207) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/apple/Documents/BPwebview/node_modules/@wry/equality/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like “./”.
(node:8207) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/apple/Documents/BPwebview/node_modules/ts-invariant/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like “./”.
(node:8207) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/apple/Documents/BPwebview/node_modules/apollo-utilities/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like “./”.
(node:8207) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/apple/Documents/BPwebview/node_modules/zen-observable-ts/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like “./*”.
Task :react-native-gradle-plugin:compileKotlin
‘compileJava’ task (current target is 1.8) and ‘compileKotlin’ task (current target is 11) jvm target compatibility should be set to the same Java version.
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (155, 32): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (161, 31): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (169, 36): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (100, 48): ‘reactRoot: DirectoryProperty’ is deprecated. reactRoot was confusing and has been replace with rootto point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): ‘ApplicationVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): ‘LibraryVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 51): ‘BaseVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): ‘ApplicationVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (132, 12): ‘LibraryVariant’ is deprecated. Deprecated in Java
w: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (252, 14): ‘BaseVariant’ is deprecated. Deprecated in Java
Task :react-native-gradle-plugin:compileJava
Note: /Users/apple/Documents/BPwebview/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
- Where:
Build file ‘/Users/apple/Documents/BPwebview/node_modules/expo-constants/android/build.gradle’ line: 3 - What went wrong:
A problem occurred evaluating project ‘:expo-constants’.
Plugin with id ‘maven’ not found.
- 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.
2: Task failed with an exception.
- What went wrong:
A problem occurred configuring project ‘:expo’.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
- 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
BUILD FAILED in 2m 7s
6 actionable tasks: 6 executed
/Users/apple/Documents/BPwebview/android/gradlew exited with non-zero code: 1
Error: /Users/apple/Documents/BPwebview/android/gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/apple/Documents/BPwebview/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
…
at spawnAsync (/Users/apple/Documents/BPwebview/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at spawnGradleAsync (/Users/apple/Documents/BPwebview/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:83:18)
at assembleAsync (/Users/apple/Documents/BPwebview/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:57:16)
at actionAsync (/Users/apple/Documents/BPwebview/node_modules/expo-cli/src/commands/run/android/runAndroid.ts:143:9)
This is my package.json
{
“name”: “xxxxxxx”,
“version”: “1.0.0”,
“scripts”: {
“start”: “expo start --dev-client”,
“android”: “expo run:android”,
“ios”: “expo run:ios”,
“web”: “expo start --web”,
“eject”: “expo eject”
},
“dependencies”: {
“@expo/config-plugins”: “^4.1.0”,
“@expo/vector-icons”: “^13.0.0”,
“@react-native-async-storage/async-storage”: “~1.17.3”,
“@react-navigation/native”: “^6.0.11”,
“@react-navigation/native-stack”: “^6.7.0”,
“axios”: “^0.27.2”,
“expo”: “^45.0.0”,
“expo-av”: “~11.2.3”,
“expo-build-properties”: “~0.2.0”,
“expo-cli”: “^5.4.12”,
“expo-device”: “~4.2.0”,
“expo-file-system”: “~14.0.0”,
“expo-linear-gradient”: “~11.3.0”,
“expo-media-library”: “~14.1.0”,
“expo-modules-autolinking”: “~0.8.1”,
“expo-modules-core”: “~0.9.2”,
“expo-sharing”: “~10.2.0”,
“expo-splash-screen”: “~0.15.1”,
“expo-status-bar”: “~1.3.0”,
“expo-system-ui”: “~1.2.0”,
“expo-updates”: “~0.13.3”,
“expo-web-browser”: “~10.2.1”,
“react”: “17.0.2”,
“react-dom”: “17.0.2”,
“react-native”: “0.68.2”,
“react-native-gesture-handler”: “~2.2.1”,
“react-native-navigation-bar-color”: “^2.0.1”,
“react-native-reanimated”: “~2.8.0”,
“react-native-safe-area-context”: “4.2.4”,
“react-native-screens”: “~3.11.1”,
“react-native-unimodules”: “~0.15.0”,
“react-native-web”: “0.17.7”,
“react-native-webview”: “11.18.1”
},
“devDependencies”: {
“@babel/core”: “^7.12.9”
},
“private”: true
}
This is my app.json
{
“expo”: {
“name”: “xxxxxxxxx”,
“slug”: “xxxxxxx”,
“version”: “64”,
“orientation”: “portrait”,
“icon”: “./assets/512.png”,
“userInterfaceStyle”: “light”,
“splash”: {
“image”: “./assets/new_splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#151D29”
},
“androidStatusBar”: {
“backgroundColor”: “#151D29”,
“translucent”: false
},
“updates”: {
“fallbackToCacheTimeout”: 0
},
“assetBundlePatterns”: [
“**/*”
],
“ios”: {
“bundleIdentifier”: “com.xxxxxxxxx.ios”,
“supportsTablet”: false
},
“android”: {
“versionCode”: 64,
“adaptiveIcon”: {
“foregroundImage”: “./assets/adaptive-icon.png”,
“backgroundColor”: “#151D29”
},
“package”: “com.xxxxxxxxx.webview”
},
“web”: {
“favicon”: “./assets/favicon.png”
},
“androidNavigationBar”: {
“barStyle”: “light-content”,
“backgroundColor”: “#151D29”
},
“plugins”: [
[
“expo-build-properties”,
{
“android”: {
“compileSdkVersion”: 31,
“targetSdkVersion”: 31,
“buildToolsVersion”: “31.0.0”
},
“ios”: {
“deploymentTarget”: “13.0”
}
}
]
]
}
}
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
45
Environment
expo-env-info 1.0.4 environment info:
System:
OS: macOS 10.15.7
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
npmPackages:
expo: ^45.0.0 => 45.0.6
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-web: 0.17.7 => 0.17.7
npmGlobalPackages:
eas-cli: 0.54.1
expo-cli: 5.4.11
Expo Workflow: bare
Reproducible demo
The problem is only I run npm run android, I did not tested on IOS yet
I’ve run expo doctor --fix-dependencies like 50 times and it never fixes this error
EXPO DOCTOR SHOWS THIS INFORMATION
expo doctor
Found all copies of expo-modules-autolinking
Expected package expo-modules-autolinking@~0.8.1 || ~0.9.0
Found invalid:
expo-modules-autolinking@0.3.4
(for more info, run: npm why expo-modules-autolinking)
Found all copies of @expo/config-plugins
Expected package @expo/config-plugins@^4.1.0
Found invalid:
@expo/config-plugins@3.1.0
@expo/config-plugins@3.1.0
(for more info, run: npm why @expo/config-plugins)
Found all copies of @expo/prebuild-config
All copies of @expo/prebuild-config satisfy ^4.0.0