Hi I’m upgrading my rn project from 0.59.9 to 0.61.5
I’ve upgraded the react-native and react package in package.json, but I found this error when trying to build by running the command react-native run-android --variant=alphaRelease
Cannot read properties of undefined (reading 'sync')
TypeError: Cannot read properties of undefined (reading 'sync')
at findProject (/Users/widhi.nugraha/projects/kbru/v1/fo-apps-v1/node_modules/@react-native-community/cli-platform-ios/build/config/findProject.js:67:35)
If I remember correctly, the react-native cli told me to unlink the packages in all of my projects. I did that, and that’s when this error happens.
This is my android/build.gradle
file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "29.0.1"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 30
supportLibVersion = "28.0.0"
kotlinVersion = "1.9.10"
kotlin_version = "1.9.10"
}
ext.kotlin_version = "1.9.1i0"
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
// maven {
// url "https://repo.spring.io/plugins-release/"
// }
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
// classpath("com.android.tools.build:gradle:3.4.0")
classpath('com.google.gms:google-services:4.3.8')
// classpath('com.google.gms:google-services:4.2.0')
// classpath 'com.google.firebase:firebase-plugins:1.1.1'
classpath 'com.google.firebase:perf-plugin:1.1.5'
// classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// ADD THIS
// maven { url 'https://maven.google.com' }
// ADD THIS
maven { url "https://jitpack.io" }
// maven {
// url "https://repo.spring.io/plugins-release"
// }
maven {
url "https://maven.google.com"
}
mavenCentral()
// Add the midtrans repository into the list of repositories
// maven { url "http://dl.bintray.com/pt-midtrans/maven" }
}
}
}
2
Answers
I just resolve the error by upgrading react-native to version 0.62.2 with the help of React Native Upgrade Helper
To check this error
you can check the file which is located at this path:
and check the type of export is correctly?