Android-EXPO: Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.

After upgrading EXPO from 41 to 42, I’m getting error when eas build.
Will be glad of any help. Thanks.

SDK 42.0.0
expo 4.12.1
eas-cli/0.31.1 win32-x64 node-v12.14.0
Windows 10

Terminal log

d:\expo\sm24>eas build
√ Select platform » Android
√ Linked to project @sendmoney24/sm24 (​Log In — Expo)
File specified via “android.googleServicesFile” field in your app.json is not checked in to your repository and won’t be uploaded to the builder.
Use EAS Secret to pass all values that you don’t want to include in your version control. Learn more: Environment variables and secrets - Expo Documentation
If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting GOOGLE_SERVICES_FILE in your build profile in eas.json to any non-falsy value.

√ Using remote Android credentials (Expo server)
√ Using Keystore from configuration: Build Credentials 4RksEVvlHf (default)
√ Compressed project files 15s (16.1 MB)
√ Uploaded to EAS 4s Learn more: fyi/eas-build-archive.md at main · expo/fyi · GitHub

Build details: Build Details — a22f3a33-b55b-4912-a1c3-4df0d1eea628 — Expo

Waiting for build to complete. You can press Ctrl+C to exit.
× Build failed

:robot: Android build failed:
Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.

Build Details log

Running ‘./gradlew :app:bundleRelease’ in /build/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-6.8-all.zip
Unzipping /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002/gradle-6.8-all.zip to /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002/gradle-6.8/bin/gradle
Welcome to Gradle 6.8!
Here are the highlights of this release:

  • Faster Kotlin DSL script compilation
  • Vendor selection for Java toolchains
  • Convenient execution of tasks in composite builds
  • Consistent dependency resolution
    For more details see Gradle 6.8 Release Notes
    To honour the JVM settings for this build a single-use Daemon process will be forked. See The Gradle Daemon.
    Daemon will be stopped at the end of the build
    [stderr] FAILURE: Build failed with an exception.
    [stderr] * Where:
    [stderr] Script ‘/build/workingdir/build/node_modules/@react-native-community/cli-platform-android/native_modules.gradle’ line: 231
    [stderr] * What went wrong:
    [stderr] A problem occurred evaluating script.
    [stderr] > Calling [node, /build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/bin.js, config] finished with an exception. Error message: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object
    [stderr] The current character read is ‘E’ with an int value of 69
    [stderr] Unable to determine the current character, it is not a string, number, array, or object
    [stderr] line number 1
    [stderr] index number 0
    [stderr] Error: ENOENT: no such file or directory, open ‘/build/workingdir/build/node_modules/react-native-webview/windows/ReactNativeWebView\ReactNativeWebView.vcxproj’ at Object.openSync (fs.js:476:3) at Object.readFileSync (fs.js:377:35) at Object.readProjectFile (/build/workingdir/build/node_modules/@react-native-windows/cli/lib-commonjs/config/configUtils.js:191:32) at Object.dependencyConfigWindows [as dependencyConfig] (/build/workingdir/build/node_modules/@react-native-windows/cli/lib-commonjs/config/dependencyConfig.js:116:49) at /build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:63:61 at Array.reduce () at getDependencyConfig (/build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:60:51) at Object.get react-native-webview [as react-native-webview] (/build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:135:18) at /build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/config/config.js:16:51 at Array.forEach ()
    [stderr] ^. Output: Error: ENOENT: no such file or directory, open ‘/build/workingdir/build/node_modules/react-native-webview/windows/ReactNativeWebView\ReactNativeWebView.vcxproj’ at Object.openSync (fs.js:476:3) at Object.readFileSync (fs.js:377:35) at Object.readProjectFile (/build/workingdir/build/node_modules/@react-native-windows/cli/lib-commonjs/config/configUtils.js:191:32) at Object.dependencyConfigWindows [as dependencyConfig] (/build/workingdir/build/node_modules/@react-native-windows/cli/lib-commonjs/config/dependencyConfig.js:116:49) at /build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:63:61 at Array.reduce () at getDependencyConfig (/build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:60:51) at Object.get react-native-webview [as react-native-webview] (/build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/index.js:135:18) at /build/workingdir/build/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/config/config.js:16:51 at Array.forEach ()
    [stderr] * Try:
    [stderr] 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.
    [stderr] * Get more help at https://help.gradle.org
    [stderr] BUILD FAILED in 13s
    Error: Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.

Hi @geperson

What are your dependencies? It looks like it’s trying to compile the Windows version of React Native WebView. :astonished:

Do you have anything like @react-native-windows in your package.json?

Hi @wodin

{
“main”: “node_modules/expo/AppEntry.js”,
“scripts”: {
“start”: “expo start”,
“android”: “expo start --android”,
“ios”: “expo start --ios”,
“web”: “expo start --web”,
“eject”: “expo eject”
},
“dependencies”: {
@eva-design/eva”: “^2.1.1”,
@expo/react-native-action-sheet”: “^3.10.0”,
@mdi/font”: “^5.9.55”,
@mdi/js”: “^5.9.55”,
@mdi/react”: “^1.5.0”,
@react-native-async-storage/async-storage”: “~1.15.0”,
@react-native-community/datetimepicker”: “3.5.2”,
@react-navigation/bottom-tabs”: “^6.0.3”,
@react-navigation/drawer”: “^6.1.1”,
@react-navigation/native”: “^6.0.2”,
@react-navigation/stack”: “^6.0.4”,
@ui-kitten/components”: “^5.1.1”,
@ui-kitten/eva-icons”: “^5.1.1”,
“axios”: “^0.21.1”,
“chalk”: “^4.1.2”,
“currency-symbol-map”: “^5.0.1”,
“datejs”: “^1.0.0-rc3”,
“eas-cli”: “^0.31.1”,
“expo”: “^42.0.0”,
“expo-app-loading”: “1.1.2”,
“expo-device”: “~3.3.0”,
“expo-facebook”: “~11.3.1”,
“expo-google-app-auth”: “^8.1.7”,
“expo-google-sign-in”: “~9.2.1”,
“expo-image-picker”: “~10.2.2”,
“expo-linking”: “~2.3.1”,
“expo-local-authentication”: “~11.1.1”,
“expo-modules-core”: “~0.2.0”,
“expo-network”: “~3.2.0”,
“expo-permissions”: “~12.1.1”,
“expo-splash-screen”: “~0.11.2”,
“expo-sqlite”: “~9.2.1”,
“expo-status-bar”: “~1.0.4”,
“expo-updates”: “~0.8.2”,
“html-react-parser”: “^1.4.0”,
“iban”: “0.0.14”,
“ibantools”: “^3.3.1”,
“js-html-parser”: “^1.0.7”,
“mdi-react”: “^7.5.0”,
“mime”: “^2.5.2”,
“moment”: “^2.29.1”,
“react”: “16.13.1”,
“react-dom”: “16.13.1”,
“react-html-parser”: “^2.0.2”,
“react-native”: “0.63.4”,
“react-native-actionsheet”: “^2.4.2”,
“react-native-animated-icons”: “^1.0.5”,
“react-native-app-intro-slider”: “^4.0.4”,
“react-native-bottom-action-sheet”: “^2.0.2”,
“react-native-gesture-handler”: “~1.10.2”,
“react-native-keyboard-aware-scroll-view”: “^0.9.4”,
“react-native-loading-spinner-overlay”: “^2.0.0”,
“react-native-modalize”: “^2.0.8”,
“react-native-paper”: “^4.9.2”,
“react-native-portalize”: “^1.0.7”,
“react-native-reanimated”: “~2.2.0”,
“react-native-safe-area-context”: “3.2.0”,
“react-native-screens”: “~3.4.0”,
“react-native-scroll-bottom-sheet”: “^0.7.0”,
“react-native-svg”: “12.1.1”,
“react-native-unimodules”: “~0.14.5”,
“react-native-web”: “~0.13.12”,
“react-native-webview”: “11.6.2”,
“react-native-windows”: “^0.64.14”,
“reanimated-bottom-sheet”: “^1.0.0-alpha.22”,
“rn-fetch-blob”: “^0.12.0”,
“styled-components”: “^5.3.0”
},
“devDependencies”: {
@babel/core”: “~7.9.0”,
“typescript”: “~4.0.0”,
@types/react”: “~16.9.35”,
@types/react-native”: “~0.63.2”
},
“private”: true
}

Uninstall the above.

Thank You @wodin.
Works :slight_smile:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.