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

Issue building with Gradle 8 and RN 0.73.4 #665

Open
victor-chan-groundswell opened this issue Feb 19, 2024 · 3 comments
Open

Issue building with Gradle 8 and RN 0.73.4 #665

victor-chan-groundswell opened this issue Feb 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@victor-chan-groundswell
Copy link

victor-chan-groundswell commented Feb 19, 2024

It seems that, when running react native 0.73.4, along with building with gradle 8, I ran into this error message.

A problem occurred configuring project ':amplitude_analytics-react-native'.

com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is disabled.
To enable the feature, add the following to your module-level build.gradle:
android.buildFeatures.buildConfig true

So I went ahead and went down the rabbit hole and looked up a way to enable this....
https://stackoverflow.com/questions/74634321/fixing-the-build-type-contains-custom-buildconfig-fields-but-the-feature-is-di

When I do that, however, then it craps out where on the react native side, with the following error:

A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.facebook.react'.
The value for property 'languageVersion' is final and cannot be changed any further.

I have already flagged this issue on the react-native github, but I'm not sure whether this needs to be looked at on this end or react-natives... either way it does not build correctly.

facebook/react-native#41580

@victor-chan-groundswell victor-chan-groundswell added the bug Something isn't working label Feb 19, 2024
@Charles-Johnson
Copy link

Charles-Johnson commented Feb 28, 2024

I'm facing a similar issue when upgrading to RN 0.73.4 as part of upgrading a managed expo app to SDK 50. I was able to fix the BuildConfig issue by adding the lines to this package's android/build.gradle

android {
  // existing code
  buildFeatures {
    buildConfig = true
  }
  // existing code
}

the languageVersion error went away after I regenerated the android directory with expo prebuild --no-install --clean -p android

@NomanGul
Copy link

this patch worked for me -> #617

@nmongiya
Copy link

nmongiya commented Apr 1, 2024

That patch #617 is not working for me :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants