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 ':react-native-gradle-plugin:compileKotlin'.

See original GitHub issue

New Version

0.69.0

Old Version

0.64.2

Build Target(s)

13

Output of react-native info

(Use node --trace-warnings ... to show where the warning was created) System: OS: macOS 12.1 CPU: (16) x64 Intel® Core™ i9-9880H CPU @ 2.30GHz Memory: 174.05 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm Watchman: 2022.07.04.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 23, 25, 27, 28, 29, 30, 31 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0 System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.2 AI-202.7660.26.42.7322048 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /Library/Java/JavaVirtualMachines/jdk-11.0.15.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.69.0 => 0.69.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Issue and Reproduction Steps

Task :react-native-gradle-plugin:compileKotlin FAILED e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 33): Unresolved reference: replaceFirstChar e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 52): Unresolved reference: it e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (252, 16): Unresolved reference: lowercase e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/Os.kt: (13, 38): Unresolved reference: lowercase e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/Os.kt: (15, 57): Unresolved reference: lowercase e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/Os.kt: (18, 54): Unresolved reference: lowercase e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/Os.kt: (19, 52): Unresolved reference: lowercase e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt: (191, 27): Type mismatch: inferred type is Unit but CharSequence was expected e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt: (191, 44): Unresolved reference: replaceFirstChar e: /Users/wartan/Documents/internationthink/medic-react-native/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt: (191, 63): Unresolved reference: it

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-gradle-plugin:compileKotlin’.

Compilation error. See log for more details

  • 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 15s

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:12
  • Comments:33 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
webdevchintancommented, Sep 6, 2022

Hey @tsaurav18 @EJ132 @mickeylam @soundaryamecse after version 0.68 RN introduce New Architecture and for that they have upgrade the Gradle version to 7+ and you must have to upgrade your gradle to 7+

so if you want to use the New Architecture then you must have to update the gradle for 0.69+ : that you have to add distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip in android/gradle/wrapper/gradle-wrapper.properties

and in android/build.gradle you have to add


classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")

for more information you can follow the React Native Upgrade Helper

hope this will work for you.

8reactions
SteveLai524commented, Oct 25, 2022

Same Problem, waiting for resolve solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: 'compileJava' task (current target is 1.8) and ...
What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'. Failed to query the value of task ...
Read more >
task :react-native-gradle-plugin:compilekotlin failed - You.com
Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRunner$kotlin_gradle_plugin'. Kotlin could not find the required ...
Read more >
Task :react-native-gradle-plugin:compileKotlin FAILED-kotlin
Gradle build failed with message: TaskDependencyResolveException: Could not determine the dependencies of task ':compileDebugKotlin' · Gradle Build Task :app: ...
Read more >
expo run:android Failing with error about Kotlin/Java
I am trying to execute expo run:android for the first time but I am getting this error: **> Task :react-native-gradle-plugin:compileKotlin** ...
Read more >
I have errors when trying to build APK and running ... - Reddit
Task :react-native-gradle-plugin:compileKotlin FAILED 'compileJava' task (current target is ... What went wrong: Execution failed for task ...
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