expo run:android -d build failed

I have tried everything and nothing is working.

I am trying to install a development build of my app that was built using expo workflow but the build is not successful both on connected device and android emulator.

I am using Windows 11. Expo SDK 46. The devices are running android 11.

The error I get

Building app...
Configuration on demand is an incubating feature.

> Configure project :expo-eas-client
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Script 'C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\expo-modules-autolinking\scripts\android\autolinking_implementation.gradle' line: 272 

* What went wrong:
A problem occurred evaluating project ':expo'.
> A problem occurred configuring project ':expo-modules-core'.
   > Failed to notify project evaluation listener.
      > NDK at C:\Users\Anaturuchi\AppData\Local\Android\Sdk\ndk\21.1.6352462 did not have a source.properties file
      > Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

* 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'.
> 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.

See https://docs.gradle.org/7.3.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 18s
Error: C:\Users\Anaturuchi\Documents\GitHub\Whook\android\gradlew.bat exited with non-zero code: 1
Error: C:\Users\Anaturuchi\Documents\GitHub\Whook\android\gradlew.bat exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\spawn-async\build\spawnAsync.js:52:23)
    at Object.onceWrapper (node:events:642:26)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.cp.emit (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\spawn-async\node_modules\cross-spawn\lib\enoent.js:34:29)  
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
    ...
    at Object.spawnAsync [as default] (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\spawn-async\build\spawnAsync.js:17:21)
    at spawnGradleAsync (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:72:46)
    at Object.assembleAsync (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:52:18)     
    at runAndroidAsync (C:\Users\Anaturuchi\Documents\GitHub\Whook\node_modules\@expo\cli\build\src\run\android\runAndroidAsync.js:31:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)  
PS C:\Users\Anaturuchi\Documents\GitHub\Whook> 

How are you building? Did you try running eas build -p android --profile development?

See here for more info:

Yes I have tried that but it fails every single time at Run Gradlew stage with the following error or another:

[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/react-native-appearance/android/build.gradle' line: 23
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':react-native-appearance'.
[stderr] > Plugin with id 'maven' not found.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':react-native-appearance'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 20s
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.
See https://docs.gradle.org/7.3.1/userguide/command_line_interface.html#sec:command_line_warnings
Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

Off hand I don’t know what the problem is. It looks strange, though. e.g. the compileSdkVersion should definitely be specified.

Do you have an android directory in your app?

Also, what dependencies and devDependencies do you have in package.json?

And, do you have a "plugins" section in app.json? If so, what do you have there?

Yes, I have an android directory in my app folder.

Package.json

{
  "name": "MyApp",
  "version": "1.0.1",
  "main": "index.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@eliav2/react-native-collapsible-view": "^1.4.0",
    "@eva-design/eva": "^2.1.1",
    "@expo/vector-icons": "^13.0.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-native-fontawesome": "^0.2.7",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/cameraroll": "^4.0.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "9.3.0",
    "@react-native-masked-view/masked-view": "0.2.7",
    "@react-native-picker/picker": "2.4.2",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.2.1",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "*",
    "@react-navigation/stack": "*",
    "@stream-io/flat-list-mvcp": "^0.0.5",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "@ui-kitten/components": "^5.1.1",
    "axios": "^0.24.0",
    "deprecated-react-native-prop-types": "^2.3.0",
    "expo": "^46.0.0",
    "expo-blur": "~11.2.0",
    "expo-camera": "~12.3.0",
    "expo-checkbox": "~2.2.0",
    "expo-dev-client": "~1.2.1",
    "expo-document-picker": "~10.3.0",
    "expo-file-system": "~14.1.0",
    "expo-haptics": "~11.3.0",
    "expo-image-manipulator": "~10.4.0",
    "expo-image-picker": "~13.3.1",
    "expo-linear-gradient": "~11.4.0",
    "expo-media-library": "~14.2.0",
    "expo-sharing": "~10.3.0",
    "expo-splash-screen": "~0.16.1",
    "expo-status-bar": "~1.4.0",
    "expo-updates": "~0.14.4",
    "global": "^4.4.0",
    "react": ">=16.8.0",
    "react-devtools": "^4.10.1",
    "react-dom": ">=16.8.0",
    "react-native": "0.69.4",
    "react-native-appearance": "~0.3.3",
    "react-native-bouncy-checkbox": "^2.1.9",
    "react-native-datefield": "^0.3.5",
    "react-native-deck-swiper": "*",
    "react-native-document-picker": "^5.0.0",
    "react-native-dom": "^0.5.0",
    "react-native-draggable": "^3.3.0",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-haptic-feedback": "^1.11.0",
    "react-native-image-crop-picker": "^0.36.0",
    "react-native-image-resizer": "^1.4.3",
    "react-native-image-slider-box": "^1.1.22",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal": "^13.0.1",
    "react-native-onboarding-swiper": "^1.1.4",
    "react-native-pager-view": "5.4.24",
    "react-native-paper": "4.9.2",
    "react-native-phone-number-input": "^2.1.0",
    "react-native-popup-menu": "^0.15.12",
    "react-native-range-slider-expo": "^1.4.2",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-share": "^5.1.1",
    "react-native-skeleton-placeholder": "^5.0.0",
    "react-native-stories-view": "^1.0.9",
    "react-native-svg": "12.3.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "^9.0.0",
    "react-native-video": "^5.2.0",
    "react-native-web": "~0.18.7",
    "react-navigation-stack": "^2.10.4",
    "stream-chat-react-native": "^3.10.2",
    "styled-components": "^5.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@babel/runtime": "^7.12.13",
    "eslint": "^7.20.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "metro-react-native-babel-preset": "^0.65.1",
    "react-test-renderer": "16.13.1",
    "rnpm-plugin-dom": "^0.5.0"
  },
  "peerDependencies": {
    "react": ">=16.8.0",
    "react-dom": ">=16.8.0"
  },
  "private": true
}

Yes, I have a plugin section in the app.json. It begins like this:

{
  "expo": {
    "userInterfaceStyle": "light",
    "plugins": [
      [
        "expo-image-picker",
        {
          "photosPermission": "Please allow us to access your photos to let you share them with others."
        }
      ]
    ],
....

Hey @anatugreen,

seems like the build is failing because your project uses react-native-appearance which was deprecated in Expo SDK 42 and removed in Expo SDK 43 announcement post: Expo SDK 43. Today we’re announcing the release of… | by Brent Vatne | Exposition.

To resolve that, you will have to remove it. You can use the Appearance and useColorScheme from react-native. For more information, see the documentation: Appearance · React Native

2 Likes

In addition to what Aman said, you have several other dependencies that
look like they are duplicates or maybe not needed.

You should remove the “community” version. It was replaced by the other
one.

Do you need this? Try uninstalling it and see if you get complaints
about prop types.

I have a suspicion that this might have been installed accidentally.

This seems to be an alternative to react-native-web? Do you need it?

Do you need both of these?

Do you need both of these?

Do you need both of these?

Do you need both of these?

I think this is out of date and should be removed.

So I would suggest that you go through all of your dependencies and
devDependencies and remove anything you don’t need. There may be more that I did not mention above.

2 Likes

I will revert after checking these.
Thank you.

2 Likes