Could not find com.android.tools.build:gradle: when executing ./gradlew generateCodegenArtifactsFromSchema
#200
-
Hi! I am trying to follow this tutorial and the https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md but current I am stuck with this error:
I have tried google and chatgpt and my efforts are in vain. This is the build.gradle of the turbo module
this is the android folder build.gradle
can someone point me out what it is I am doing wrong? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
Please use this template https://github.com/react-native-community/reproducer-react-native to create a reproducer of your failure, and I can then point you in the right direction 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi @cortinico , Thank you very much for extending a helping hand. As requested this is the reproducer repo: https://github.com/silencer07/codgen-error-reproducer-react-native/tree/main/ReproducerApp Note: I put the |
Beta Was this translation helpful? Give feedback.
-
Hi @cortinico, Just wanna bump the discussion. Any insights how to fix this? Thanks |
Beta Was this translation helpful? Give feedback.
-
Hey @silencer07 my apologies for the late reply but I missed this post. The problem you have are in the Gradle file of your project: If you're looking into publishing a library, please update the file with the following content: buildscript {
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
google()
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.facebook.react'
apply plugin: 'org.jetbrains.kotlin.android'
android {
compileSdkVersion safeExtGet('compileSdkVersion', 34)
namespace "com.meccabrands.SplashScreen"
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.facebook.react:react-native'
} |
Beta Was this translation helpful? Give feedback.
Hi @cortinico,
I enabled github actions in my repo. It complained about lock file that will be updated. I run
yarn install
and for some reason this error went away.What a relief! I think the error messsage should be improved (i.e. point out the problematic yarn lock file instead of the error in this thread)
Thank you very much. you are such a big help!