# Changing targetSdkVersion?

**URL:** <https://discourse.processing.org/t/changing-targetsdkversion/14723>\
**Category:** Processing for Android\
**Created:** [October 15, 2019, 6:53pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723 "2019-10-15T18:53:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 15, 2019, 6:53pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/1 "2019-10-15T18:53:00Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 15, 2019, 7:02pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/2 "2019-10-15T19:02:02Z")

</div>

> **[r/processing - Changing targetSdkVersion?](https://www.reddit.com/r/processing/comments/dibrfy/changing_targetsdkversion/)**
>
> 0 votes and 1 comment so far on Reddit

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 18, 2019, 10:11pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/3 "2019-10-18T22:11:54Z")

</div>

You mean [this](https://discourse.processing.org/t/how-to-target-android-sdk-version-28-in-order-to-put-an-app-on-the-play-store/13348/8)?  
Or [this](https://discourse.processing.org/t/how-to-target-android-sdk-version-28-in-order-to-put-an-app-on-the-play-store/13348/14)?

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [October 19, 2019, 10:29am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/4 "2019-10-19T10:29:38Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 20, 2019, 10:53am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/5 "2019-10-20T10:53:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2019, 2:38pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/6 "2019-10-20T14:38:20Z")

</div>

Have you read [this](https://github.com/Calsign/APDE/wiki/Exporting-as-a-Signed-Package)?

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 26, 2019, 10:50am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/7 "2019-10-26T10:50:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 26, 2019, 10:59am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/8 "2019-10-26T10:59:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 7:32am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/9 "2019-10-29T07:32:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 8:46am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/10 "2019-10-29T08:46:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 9:12am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/11 "2019-10-29T09:12:12Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 9:15am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/12 "2019-10-29T09:15:18Z")

</div>

Could you give me the link to try it?

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 9:22am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/13 "2019-10-29T09:22:45Z")

</div>

Do you mean the appstore link?

> <https://play.google.com/store/apps/details?id=processing.test.sketch_20191026d>
>
> Try to fly with you airplaine avoiding obstacles and reach the space...

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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 9:43am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/14 "2019-10-29T09:43:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 9:50am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/15 "2019-10-29T09:50:06Z")

</div>

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

my setup method right now looks like this:

```auto
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?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 9:57am UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/16 "2019-10-29T09:57:25Z")

</div>

Along setup() you write another function

```auto
public void settings() {  
  fullScreen();   
}

```

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 6:06pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/17 "2019-10-29T18:06:02Z")

</div>

Unfortunately it crashes anyway ☹  
I have tried this way

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

```

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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 7:06pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/18 "2019-10-29T19:06:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bertin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bertin/32/391_2.png) [@bertin](https://discourse.processing.org/u/bertin)\
**Post date:** [October 29, 2019, 7:48pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/19 "2019-10-29T19:48:12Z")

</div>

This actually works.

```auto
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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 29, 2019, 8:00pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723/20 "2019-10-29T20:00:35Z")

</div>

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

[Next page](https://discourse.processing.org/t/changing-targetsdkversion/14723.md?page=2)
