Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing realm on RN 0.74.1 does not compile the app as it adds RN 0.75.2 and gradle version 8.7 #6875

Open
ishdeepsidhu opened this issue Sep 1, 2024 · 3 comments

Comments

@ishdeepsidhu
Copy link

How frequently does the bug occur?

Always

Description

I have been trying to install realm on my react-native app. After intalling the app asks for gradle version 8.7. When I check the app it adds RN 0.75.2 because I think somewhere there is a condition which says > 0.68.

I tried upgrading my entire project to 0.75.2 but then it does not compile. The build process gets stuck at app.

Stacktrace & log output

* Where:
Build file 'F:\pp\Shary\Shery\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 8.7. Current version is 8.6. If using the gradle wrapper, try editing the distributionUrl in F:\pp\Shary\Shery\android\gradle\wrapper\gradle-wrapper.properties to gradle-8.7-all.zip

Can you reproduce the bug?

Always

Reproduction Steps

Start an app in 0.74.1. Add realm and @relam/react. Try compiling the application. It asks for gradle 8.7.

Version

12.3.1

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

React-native 0.74.1

Build environment

Which debugger for React Native: ..
Windows is my operating system. And using JAVA. Not sure what else is there.

Cocoapods version

No response

Copy link

sync-by-unito bot commented Sep 1, 2024

➤ PM Bot commented:

Jira ticket: RJS-2899

@vm-ntrigub
Copy link

Is this issue in progress?

@vunl2000
Copy link

vunl2000 commented Oct 1, 2024

you can try:
android > settings.gradle
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = .....

app/build.gradle
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")

//   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
//   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")

/* Variants */
//   The list of variants to that are debuggable. For those we're going to
//   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
//   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]

/* Bundling */
//   A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
//   The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
//   The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
//   The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
//   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
//   A list of extra flags to pass to the 'bundle' commands.
//   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
//   The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
//   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

// I add this line.
  • /* Autolinking */
  • autolinkLibrariesWithApp()
    }
    ...

// It will be at the bottom of the file.
// I removed this line.

  • apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-8.7-all.zip

It works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants