How to adjust the API level when exporting signed package for Android?

I am trying to add my first app to the google app store and when uploading the signed_aligned APK I get the following error:
Your app currently targets API level 28 and must target at least API level 29 to ensure it is built on the latest APIs optimized for security and performance. Change your app’s target API level to at least 29.

Looking around, it seems there was a similar post about level 26 -> 28 and the responder seemed to suggest signing it with android studio. Is there a way to change the package to 29 through processing? If not why isn’t this implemented and what would you recommend I use?

  • Just in case I need to mention, adjusting the android:targetSdkVersion value gets re-set when exporting.

Thanks.

@Mowtine ===

P5 uses a template when generating the Manifest: you cannot change the API to 29. If you need to change it you have to use Android Studio && gradle.

Would you mind linking me a tutorial/guide for that? can a processing sketch just be run in android studio?

@Mowtine === you download and install AS; from P5 you export your sketch: it creates a folder where are your files; from AS you “import from existing code” and point towards the folder created by P5; then you can change the API from 28 to 29 using the build from gradle. At the end you create your release with AS and everything is ok.

Great, is there any benefit to using API’s more recent than 29?

Alright, ran into a problem doing that and the solutions I found don’t seem to be working:

After importing the app folder from the exported sketch from Processing I get the following error:
Unable to find method ‘org.gradle.api.internal.TaskInputsInternal.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;’.

Looking it up it seems that some people got this issue because of the gradle version, changing that in my gradle-wrapper.properties does not change the issue when I try to sync again.

Any ideas?

I just opened a project in AS to see if I can help you. I selected the android view instead of project or project files view. This gives you the app and gradle scripts. When I look at gradle-wrapper.properties it shows which gradle version for the line giving a download URL. This isnt the same as the version you will use for your app. If I look at the build.gradle for the Module: app, that’s where the SDK version is set. There is another build.gradle and that’s for the Project: yourprojectname, that sets the gradle version that your project needs.

Try this, start a new project in AS and when you set it up with the wizard, set your target and compile and minimum SDK the way you want and then examine all the gradle script files and look for the differences with your current project.