-
Notifications
You must be signed in to change notification settings - Fork 264
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] Version 0.2.4 requires targetSdkVersion = 31 #812
Comments
You're right- this is due to a bump in the ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
- compileSdkVersion = 30
- targetSdkVersion = 30
+ compileSdkVersion = 31
+ targetSdkVersion = 31
ndkVersion = "21.4.7075529"
} |
Unfortunately in our case this breaks other dependencies. I recall seeing somewhere on a facebook/react-native issue a recommendation against changing the SDK target because the one targeted by RN might be relied on by internal and external dependencies. So while this may not be a bug, I suspect this will be a recurring question as long as the default RN target remains at 30. For our project I think I'll have to leave it pinned at 0.2.3 for the time being. |
I see, that makes sense. Sorry about the unforeseen break there. Luckily React Native 68 looks like it will target sdkVersion 31 |
Thats good, I'm content to leave this here for anyone else that stumbles on it and will make a point to close this once React Native 68 is released. |
We have the same problem in our project after updating to 0.2.4 Waiting for RN 68 will take forever for Expo users. Is there another option to just waiting? |
Another option (for those who prefer not to target Android 12), would be to force the resolution of the You can do this by adding the following to your
|
Thank you @charliecruzan-stripe! |
If you're using the Expo managed workflow, I'm not sure how you applied the patch above...you don't have access to native build files |
I don't, using the bare workflow. |
We're on React Native 0.64.2, and I was only able to build using the fix from @charliecruzan-stripe in this thread AND the fix here (specifically, the one for flutter): stripe/stripe-android#3173. Upgrading RN is not our top priority at the moment so I guess we are stuck with this for now. |
we followed the steps outlined by @charliecruzan-stripe and that solved the build errors, but now we're seeing a crash relating to Klarna when we try to initialize the payment screen on android. any suggestions? everything works as expected on iOS... |
Ah, yeah that makes sense. We added in the Klarna payment method, and it must not be available in |
thanks for the reply @charliecruzan-stripe i see... so is the latest release just straight up broken? or rather was there a breaking change introduced that can't be resolved without upgrading to RN 0.68? That seems a little short sided considering RN 0.68 hasn't officially been released, so upgrading isn't really a viable solution just yet. i'll try |
No, it's not broken, it just targets Android SDK 31 which was released last year in October. You can update the targeted Android version outside of updating React Native.
It's not about disabling the payment method, it's about not having the code that even references that payment method in your android source. To remove that, you'd need to edit |
RN 0.68 has been out a while now, and Expo's SDK 45 also targets 68, so I'm going to close this issue now |
@charliecruzan-stripe Is it API 31 or 32 now? ON the main read me, it says 32, but API 31 is not the enforced target until NOV this year. Here is why I ask. We use/used With Target API 31 am rebuilding our app, but this is a bit of a mess. At the resolving dependencies stage to get the old app code to run on the new RN core, and of course, the fresh core can't find This issue the README links to says the target is 31, but the readme says 32. Is this issue or that readme the correct target for this library? |
The readme is correct, it's 32. It just points to this issue for workarounds:
|
@charliecruzan-stripe, as your linked to source says
the best practice is to have these 2 matched with very few exceptions. So if updating
Basically, our old app can not build using 31; so rebuilding on a new core. But STRIPE it seems is a breaking change here. The current ver of this library won't To be honest, I do not even have 32 or 33 installed, they go through so many revisions and they are "beta" targets right now. Ideally, you wait until they are not their number but their Android OS Ver: I belive 12L and 13. Is there a reason STRIPE is forcing beta usage? I opened a case on the "pod error" here seems at least one more person is having it. If it comes to it and other things are not 32 ready we use, what ver should be rolled back to for STRIPE to be 31 compliant? Wondering if that might fix the POD error. Is the "current" ver of STRIPE intended to be beta, and we actually should be installing the last "stable"? |
Any
Can you elaborate on this? In your example above, you have compileSdkVersion still set to 30, which will not work on the most recent version of Stripe React Native. Also, Android 12 was released publicly on October 4, 2021, so 32 is not a beta target. |
@charliecruzan-stripe respectfully anything higher than Google mandated targets is "beta" they release and endlessly update. It takes time for everything to be good and ready. They roll forward in August and November of each year. Most stable apps are following the minimum target for full library and decency access.
Yes, and this is the issue with Stripe pre-targeting. The app won't build using Because today the target is 30 or 31 depending if you are a new or old app. I will have no clue if this can even build on 32 until I get there, as was stated goal was to build for 31 to be Nov 2022 compliant. The default install should be one that targets the current google and apple targets, and anything higher should be a beta |
"Google mandated targets" isn't exactly specific enough, in my opinion. Google has different enforcements for new apps vs updates to existing apps. New apps must target Android 12 (API level 31) or higher in order to be submitted to Google Play, whereas the Nov 2022 deadline you're referring to is for updates to existing apps. So Google is already enforcing API level 31, and I think calling it "beta" isn't accurate Also this isn't exactly relevant, as that refers to |
@charliecruzan-stripe vocab debate aside the point is 32 is not the current target recommended; and is a breaking requirement for many things. And it is bad practice for But since the current ver of Stripe is not targeting google targets what was the last ver that did? |
This change was listed as a breaking change for v0.18.0. We need to set |
@charliecruzan-stripe and what ver was that? and would it have current patches and features? |
v0.2.3 can be used in projects that have v0.17.0 can be used in projects that have
Unfortunately no, since without bumping |
I still have same error, is there are any chance to fix it Expo managed workflow? |
Expo's managed workflow controls your |
I did find a way to force change it a few months ago https://forums.expo.dev/t/managed-eas-build-how-to-edit-build-gradle-via-mods/55004/2 Now strangely it is not working for 32, it did work for 30->31. Maybe because I am using app.config.json instead of app.json. UPDATE: this works https://docs.expo.dev/versions/latest/sdk/build-properties |
- Bumping to 0.2.4 requires Android SDK, see stripe/stripe-react-native#812.
- Bumping to 0.2.4 requires Android SDK, see stripe/stripe-react-native#812.
As a solution for Expo Bare, it's possible to use the
|
@charliecruzan-stripe here is my configuration and version
build.gradle
Now error saying to use compileSdkVersion 32. but compileSdkVersion 32 is not supported in the new react native (0.70.6) |
Describe the bug What went wrong: Expected behavior react-native info "react": "17.0.2", build.gradle |
Stripe android lib needs compileSdkVersion = 31 ref stripe/stripe-react-native#812 To not break anything else in the RN space, we need to bump to RN 0.68
Stripe android lib needs compileSdkVersion = 31 ref stripe/stripe-react-native#812 To not break anything else in the RN space, we need to bump to RN 0.68
Describe the bug
The latest version of the library (0.2.4) appears to break the build process for RN Android projects due to requiring a higher
minCompileSdk
than is specified in standard React Native projects.To Reproduce
Steps to reproduce the behavior:
npx react-native init
yarn add @stripe/stripe-react-native
yarn run android
Expected behavior
The app builds successfully when using the library with fresh RN projects.
Screenshots
N/A
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: