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

Error: Google Play requires that apps target API level 31 or higher. #566

Closed
sennedl opened this issue Jul 26, 2023 · 9 comments
Closed

Comments

@sennedl
Copy link

sennedl commented Jul 26, 2023

When I Build unsigned APK of the azure pipeline. There is a problem with the targetSdkVersion.

Does someone issues the same problem? Or does someone can help me?

Screenshot 2023-07-26 at 16 14 17
@scarlac
Copy link
Collaborator

scarlac commented Jul 26, 2023

Please provide a repository that reproduces this issue. You may want to check that the defaultConfig is specifying the target sdk in your main app.

@a2f0
Copy link

a2f0 commented Jul 28, 2023

I have this same issue and have confirmed the defaultConfig is specifying the target SDK version in the main app. I don't have a public repro of this at the moment but posting here in case other users run into this.

@sennedl
Copy link
Author

sennedl commented Jul 31, 2023

I don't have repo I can share. But the ext in my build.gradle is the following one.

Screenshot 2023-07-31 at 16 51 02

It is something required for new android apps
target-sdk

@DavidBertet
Copy link
Contributor

If you run that command

yarn android

From example/ folder, and check the apk

$ANDROID_HOME/build-tools/33.0.2/aapt dump badging android/app/build/outputs/apk/debug/app-debug.apk | grep targetSdkVersion

It does contain

targetSdkVersion:'33'

Coming from the example project example/android/build.gradle

buildscript {
    ext {
       ...
        targetSdkVersion = 33

And not 30 from the framework defaultConfig

@sennedl You might have to update targetSdkVersion from your project, seems like you have 30

@sennedl
Copy link
Author

sennedl commented Aug 10, 2023

@DavidBertet I share the wrong screenshot. I have the targetSdkVersion = 33 and it fails as well.

The pipeline said it's the react-native-camera-kit in the node_modules

/home/vsts/work/1/s/node_modules/react-native-camera-kit/android/build.gradle:8: Error: Google Play requires that apps target API level 31 or higher.
 [ExpiredTargetSdkVersion]
        targetSdkVersion 30
        ~~~~~~~~~~~~~~~~~~~

Is there something to do about this?

@DavidBertet
Copy link
Contributor

Could you share what is your Build unsigned APK pipeline doing?

Seems like you are linting react-native-camera-kit, any reason doing that?

While Google Play requires apps to target API level 31, and 33 at the end of the month, that's a Google Play limitation
Someone that would want to use react-native-camera-kit on internal stores could use anything they want

More details about your setup should help reproduce / find what the solution needs to be

@DavidBertet
Copy link
Contributor

I pushed a potential fix after reproducing something similar on the example project

./example/android/gradlew lintDebug

@scarlac
Copy link
Collaborator

scarlac commented Aug 14, 2023

Should be fixed with @DavidBertet's PR. Thanks David! Closing. Please open a new issue if the issue persists.

@scarlac scarlac closed this as completed Aug 14, 2023
@ahmetkuslular
Copy link

I patched the package by making minSdkVersion = 24. Then I pulled my own project to the same version, but the same error continues.

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

No branches or pull requests

5 participants