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.

Execution failed for task ':expo-modules-core:compileDebugKotlin'.

See original GitHub issue

Summary

When trying to run expo run:android, I am getting the following error:

Execution failed for task ':expo-modules-core:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' used by Gradle. Make sure Gradle is running on a JDK, not JRE.

* 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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 15s
280 actionable tasks: 279 executed, 1 up-to-date
/Users/douglas/Projects/app-mobile/android/gradlew exited with non-zero code: 1

I am trying to run my application on my physical device to debug (specifically react-native-image-picker, since it allows multiple images selection, that’s why I’m not using Expo Go). My mobile device is connected via USB cable and when I run adb devices I get the following:

List of devices attached
0060032002	device

So my device seems fine, so it might be a bug with Expo.

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)

No response

Environment

Expo CLI 4.13.0 environment info: System: OS: macOS 12.0.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Watchman: 2021.11.15.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 30, 31 Build Tools: 29.0.2, 31.0.0 IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.1/13A1030d - /usr/bin/xcodebuild npmPackages: expo: ^43.0.0 => 43.0.3 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: expo-cli: 4.13.0 Expo Workflow: bare

Reproducible demo

  • Run expo init as bare workflow
  • Allow USB Debugging on your Android device
  • Connect USB cable to MacOS
  • Enture adb is installed. If not, install in your machine
  • Run adb devices and see if your device is listed correctly
  • cd into your project and run expo run:android

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
lahfircommented, Apr 26, 2022

Hi @doougui! It’s most likely related to something that is or isn’t installed on your Mac. This stack overflow answer might help. You could also try to build with Android Studio, that should auto-install all required components. Basically, expo run:android builds your app, from source, locally. And because of that, it needs everything installed for Android/Kotlin. The steps you provided are working fine for me. Hope this helps!

Thank you for your reply. You’re right. The thing that was missing was JDK 8. As soon as I installed it I could run the app both in my physical device and on Android Studio with AVD. Sorry for any inconvenience since this issue isn’t really related to Expo 😃

Could you please elaborate how you did it?

4reactions
davidcortcommented, Nov 6, 2022

I’m having the same issue after update to Ventura 13 on my Mac Book 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Execution failed for task ':expo-modules-core ... - Stack Overflow
Before I didn't have the kotlin version configured in android/build.gradle but with each version, I get a different error. Please help.
Read more >
react native expo - Execution failed for task
Everything worked fine, build successfully, but when I execute the command eas build -p android --profile preview , it crashes/build-fails after ...
Read more >
Execution failed for task ':app:compileDebugKotlin' in Android ...
Execution failed for task ':app:compileDebugKotlin' in Android Studio || Flutter || ERROR SOLVED ✓. 8.3K views 6 months ago.
Read more >
Android studio | Execution failed for task - YouTube
Here, given trick to solve this type of error. Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for ...
Read more >
Error while evaluating property 'extraGeneratedResDir' of task
In this video i show you , How to fix " Execution failed for task ':app:mapDebugSourceSetPaths'. Error while evaluating property ...
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