Changing targetSdkVersion?

Hi all!
I’m trying to publish my first android game on the Play Store, but when I try to upload my apk, which I have exported with Processing, Google rejects it, saying that my targeted sdk versione is 26, while the minimum required is 28. I have tried to edit it in the AndroidManifest.xml but it is overwritten when I rebuild the application.

I have found another topic with the same issue but I can’t understand the proposed solution.

Any help would be appreciated.

trank you!

You mean this?
Or this?

@noel ===

  • working with PC && android mode i think that you cannot target more than MM because the manifest seems (i have looked at that time ago) to be hard coded; so the only way is to import your project in AS where you can override all values in the gradle build for the app
  • working with APDE i dont know, i never used it till now but it seems possible

Both. I tried to install Android Studio and change the gradle file but then I don’t understand how to build the aligned apk, i have never used android studio before.

As well APDE, I tried to install it on my phone but i can’t understand how to use it.

Have you read this?

Thank you for the source. How do I import my project on the phone? I have it on my comuter , seems like I have to copy paste in the APDE application? I guess I will try it that way

Personally I use Google Drive for storing my sketches.
On my phone I use a free app called “Folder sync”. With that you can load or save your project into “Drive” with just one click.

Thank you for your answers, I managed to publish the app on the store.
There is a little problem now… I downloaded it from the store but when I try to open it crashes instantly, it didn’t even open.

Do you have any idea how can I understand where the problem is? Obiously the application runs perfectly when I deploy it on my phone through processing

Did you export it with APDE? And if so, did you give all the needed permissions? Sometimes it runs well, specially in preview mode. It is also difficult to find out without knowing what kind of code is in you sketch.

Yes, I exported it in APDE. I didn’t check any permission in the sketch settings since I didn’t think I had to, my game is really basic, I haven’t imported any external library or use some particular functionality of the phone, a part from the touchscreen obviously (I implemented the mouseDragged method). I have a bunch of images in the data folder also, I don’t know if it’s relevant. In the setup method I have used fullScreen(P2D).

Could you give me the link to try it?

Do you mean the appstore link?

yes, I haven’t changed the package name at the beginning and now I’m not able to change it anymore since it is uniquely linked to my account I guess

It seems to give a “processing/core/PSurfaceNone” error.
Where did you put the size() function.
You have call it inside settings() instead of setup() when running your code outside the PDE

I haven’t used the size() function since I called fullScreen

my setup method right now looks like this:

void setup() {
  fullScreen(P2D);
  init();  //it's the initialization of all my objects
}

should I just replace the method name setup with settings in APDE?

Along setup() you write another function

public void settings() {  
  fullScreen();   
}

Unfortunately it crashes anyway :frowning:
I have tried this way

void setup() {
  fullScreen(P2D);
  init(); 
}
public void settings() {  
  fullScreen();   
}

and published an internal test on google play, but the app crashes instantly

You wrote fullScreen() in setup() as well?
It’s supposed to be set only in settings().
We pay for publishing on Google Play just once isn’t it.
Could you try to export a sketch with just a colored background in setup(); and with size(200, 200); in settings()? Just to be sure that it has nothing to do with your code?

1 Like

This actually works.

void setup() {
  background(255,0,0);
}
void settings() {
  size(200,200);
}

edit: I am an idiot. I have just realised that I copy-pasted the code in APDE but I have not imported the data folder with all my images. It will always crashes for that right? I have to find a way to import those in apde

Just open the sketch folder than the folder with your sketch name. Then create a folder named data and put your images in it.

1 Like