-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
[Android] builds will likely break on RN 0.75 / Expo 52 #2812
Comments
@jamsch FYI, I tried to remove the line "supportLibVersion" in android/build.gradle, that can fix the build broken |
@leaguefun I ran into the same problem on RN 0.75.2 and removing the |
Same error |
I create this patches, this can fix the build error when use expo 52 & reactNative 0.76 |
I'm testing the SDK 52.0.0-preview.12 and RN 0.76.1 and can confirm that the Android build is broken
|
Should be fixed on latest version |
@jamsch Where/how is this issue addressed? Currently, the latest is of react-native-iap is 12.15.7 (which I'm using) , but I'm receiving the error mentioned above. Here's the simplest way I reproduced the issue:
|
@CoatedMoose I'm in the same boat. I was able to get it to build by changing this file benawad@9c2c2a8 but idk if it will break anything in production. Just doing a dev build right now |
@benawad I can see how that would work. The project can clearly depend on either androidx or support library - if it's working for you at all, I would not expect any issue. That change you referenced will be at the expense of compatibility (anyone that still depends on the support lib). The check you're deleting in favour of an explicit dependency is assuming the support lib when
|
I confirm that this issue exists. The issue arose after updating an Expo-managed project to SDK 52. react-native 0.76.2 |
Updating to 12.15.7 did not solve this problem.
Why is the issue closed before it is actually solved? |
Has this issue been resolved? I have been unable to find the cause, and I am in urgent need to debug the Android payment function. |
solved: react-native-iap/android/build.gradle android/gradle.properties prebuild, clean gradlew & cache -------UPDATE |
I had exactly the same problem. RN: 0.76.3 |
Same problem. Any updates? |
Still happening with:
|
I am facing the same problem, and now I am really stucked to update my app 😞 ... I just tried to downgrade to Expo version to SDK 51 and other problems appears, both on iOS and android. Is there any update on this? |
Workaround for building Expo apps with EAS Add const fs = require('fs')
const path = require('path')
const gradleFilePath = path.join(
__dirname,
'..',
'node_modules',
'react-native-iap',
'android',
'build.gradle',
)
try {
let gradleFileContent = fs.readFileSync(gradleFilePath, 'utf8')
const lineToReplace =
'def supportLibVersion = getExtOrDefault("supportLibVersion")'
if (gradleFileContent.includes(lineToReplace)) {
gradleFileContent = gradleFileContent.replace(
lineToReplace,
'def supportLibVersion = false',
)
fs.writeFileSync(gradleFilePath, gradleFileContent, 'utf8')
console.log('Line removed from build.gradle successfully.')
} else {
console.log('Line not found in build.gradle.')
}
} catch (error) {
console.error('Failed to modify build.gradle:', error)
} Add post-script to {
...
"scripts": {
...
"postinstall": "node postinstall.js"
},
...
} Run |
Thank you @WhidRubeld for providing the postinstall.js workaround! I tried your solution, but I encountered the following error when running it during the build:
It seems the issue was related to the script using __dirname to construct the path, but during the build, the working directory was actually /home/expo/workingdir/build. This caused the script to fail because it was looking in the wrong location for the build.gradle file. To fix this, I updated the script to use process.cwd() instead of __dirname to dynamically determine the current working directory. Here’s the updated script:
After making this change, the script worked as expected during the build process. Thank you again for the starting point, it really helped! I hope this updated version can assist others who might encounter a similar issue with the working directory. |
I could solve this problem with jetifier install jetifier
and enable it in gradle.properties
then run
What it does is it replaces all com.android.support dependencies to android. Don't ask me why after that I could run
and starn the app in emulator |
I confirm the issue is still happening. Setting |
Two ways to make android app able to run:
Unfortunately, my project is using expo 52 and create android project from nothing every time when build. There's no way to config these two files. I hope this issue can be fixed soon without updating android project manually each time. |
I have the same issue, see expo/expo#30725 This seems to be pretty urgent as it's incompatible with the latest Expo updates. |
still having it :((
|
Anybody got this workaround to work with going through EAS? I tried both WhidRubeld and otmancra workarounds to no avail. Removing the line "supportLibVersion" in android/build.gradle works but only locally. |
Maybe you are doing a production build. In this case you will have to connect the script like this in package.json.
|
this pr #2904 can fix |
Hi,
Just letting the maintainers of this library know that the
enableJetifier
option will be removed from upstream React Native / Expo:facebook/react-native@14ccf6b
expo/expo@3774717#diff-c1abe9eea32a8e683dbea2f18a322cc0b8c5a4ce1a8da1719c6a9ddf29f79e3fL28
Because the
enableJetifier
option is removed, the following lines:https://github.com/dooboolab-community/react-native-iap/blob/561586988df9bf9b282f7fca410d2c4eb25cf587/android/build.gradle#L171-L174
Resolves in a bare Expo SDK 51 app as the following:
Which results in the following error:
For context, earlier this week I had run in to this issue after Expo deployed an update to their bare native template that included the removal of
enableJetifier
, but it was later reverted because of the above build issue mentioned here: expo/expo#30725The text was updated successfully, but these errors were encountered: