react-native
react-native copied to clipboard
Could not get unknown property 'publishing_version' for project ':ReactAndroid' of type org.gradle.api.Project.
Description
Occurs when upgraded react-native from 0.68.1 -> 0.70.1
at node_modules\react-native\ReactAndroid\hermes-engine\build.gradle
group = "com.facebook.react" version = parent.publishing_version
The Gradle file is not able to locate the property publishing-version.
Version
0.70.1
Output of npx react-native info
System: OS: Windows 10 10.0.19044 CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Memory: 949.90 MB / 7.89 GB Binaries: Node: 16.2.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 23, 28, 29, 30, 31 Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 31.0.0 System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom Android NDK: 22.1.7171670 Windows SDK: Not Found IDEs: Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7583922 Visual Studio: Not Found Languages: Java: 14.0.1 - C:\Program Files\OpenJDK\jdk-14.0.1\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.1 => 0.70.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Try to upgrade from 0.68.1 -> 0.70.1 using https://react-native-community.github.io/upgrade-helper/?from=0.68.1&to=0.70.1
Snack, code example, screenshot, or link to a repository
Are you patching react-native by any chance?
Publishing version is defined inside node_modules/react-native/ReactAndroid/build.gradle
.
You're not supposed to change it.
https://github.com/facebook/react-native/blob/0b4417b43f66e3de91e9d54099440be14d97434b/ReactAndroid/build.gradle#L171-L173
@bhsrampage any new findings here? Also facing the same issue when enabling hermes, but not using new architecture. Is it possible to use hermes and not the new architecture with RN 0.70.3 at the same time? Btw. we patch RN, but just the file path due to monorepo, but nothing which could cause that error. I hardcoded the version and then it went through but ends with "couldn't find DSO to load: libhermes-executor-release.so".
I have the same exact issue, but I haven't patched any react-native file.
@bhsrampage any new findings here? Also facing the same issue when enabling hermes, but not using new architecture. Is it possible to use hermes and not the new architecture with RN 0.70.3 at the same time? Btw. we patch RN, but just the file path due to monorepo, but nothing which could cause that error. I hardcoded the version and then it went through but ends with "couldn't find DSO to load: libhermes-executor-release.so".
not really sure but i think the latest versions of rn requires new architecture with Hermes which is enabled by default. For time being i reverted back to the older version which was working for me I'll upgrade it once i find a robust solution solution to this issue.
Are you patching react-native by any chance? Publishing version is defined inside
node_modules/react-native/ReactAndroid/build.gradle
.You're not supposed to change it.
https://github.com/facebook/react-native/blob/0b4417b43f66e3de91e9d54099440be14d97434b/ReactAndroid/build.gradle#L171-L173
haven't patched the package when i upgraded the version in package json i deleted the node modules and installed them again.
Is it possible to use hermes and not the new architecture with RN 0.70.3 at the same time?
Yes, you can use Hermes without the New Architecture.
the latest versions of rn requires new architecture with Hermes which is enabled by default.
Nope, the latest version of React Native does NOT require the New Architecture. It's actually an opt-in at the moment.
Can someone provide a reproducer here?
:warning: | Missing Reproducible Example |
---|---|
:information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
My problems with hermes where homemade. Some of my native colleagues (using nativ first, then RN after login) "optimized" our code so the APK does not contain the libhermes-executor-debug.so as it was included even for the release APK. Therefore they made the following changes deep in the build.gradle:
exclude '**/libhermes-inspector.so'
exclude '**/libhermes-executor-debug.so'
In addition during our last upgrade of RN we had to set:
enableVmCleanup: false
to make hermes run. I had to remove both changes to make hermes run again with 0.70.3.
I had this same issue, was a mistake in the upgrade process. I had copied the changes to android/settings.gradle
incorrectly putting the new files at the bottom of the file rather than inside the new arc if block
https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.69.7/RnDiffApp/android/settings.gradle
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
at node_modules\react-native\ReactAndroid\hermes-engine\build.gradle
group = "com.facebook.react" version = parent.publishing_version
Closing as this issue is completely solved in 0.71
We removed the need to build ReactAndroid\hermes-engine\build.gradle
entirely when creating a new project.
So please update to 0.71 and report again if you're having furhter issues