Ooops
May 31, 2020, 05:20:37 PM

Author Topic: Uploading .apk file to Google play console  (Read 2129 times)

Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Uploading .apk file to Google play console
« on: January 20, 2018, 01:55:34 PM »
Hi guys,

I'm attempting to get my first Android game onto the Google playstore but having some confusion issue happening.
Under the "App releases" I'm trying to upload my .apk file but each time I do, it comes up with this:

Code: [Select]
Upload failed
You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs.

You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode. Learn more about signing.

I don't understand what I am missing, as when I do the compile in Monkey using either Ted or Mollusk, I set it to release and in Ted you can see it sets -config=release. So why does Google still think I'm trying to give it a debuggable apk?
Android is new to me, so is there something I need to set in my code to make it release build or what else could I be missing?

Thanks!
Jaco
Retro gaming fan and maker sometimes...

Offline Matty

  • Hero Member
  • *****
  • Posts: 1034
    • MattiesGames
Re: Uploading .apk file to Google play console
« Reply #1 on: January 20, 2018, 06:58:19 PM »
You need to create a 'keystore' file (look it up on google) and sign the apk with that.

From memory Monkey uses a debug-key which has a lifetime of about a year before it expires.

The key you need to create (command line utility will do it) has to last until about 2035.

I haven't created one in probably 5 years and have been using the same one since then...but what it usually involves is after compilation you 'sign' it with the key.

In Java with Eclipse it is easy...In Monkey I think you need to open the .apk (it's just a zip file) remove a file and then sign it...but someone else with more knowledge can fill you in on the other details.

Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Re: Uploading .apk file to Google play console
« Reply #2 on: January 20, 2018, 08:44:46 PM »
You need to create a 'keystore' file (look it up on google) and sign the apk with that.

From memory Monkey uses a debug-key which has a lifetime of about a year before it expires.

The key you need to create (command line utility will do it) has to last until about 2035.

I haven't created one in probably 5 years and have been using the same one since then...but what it usually involves is after compilation you 'sign' it with the key.

In Java with Eclipse it is easy...In Monkey I think you need to open the .apk (it's just a zip file) remove a file and then sign it...but someone else with more knowledge can fill you in on the other details.

Hi Matte, that was a great tip thanks!

I use a script that @Jayenkai made quite a while back for my Ouya builds which seems to work. I then modified it to do the same for Android. And yes, you delete the META-INF folder in the .apk file.
This is the .bat script file:

Code: [Select]
echo off
echo "-=-=-=-=-=-=-=-=-=-=-=-="
echo "REMINDER"
echo "    Be sure you're using"
echo "    Java 6, NOT Java 7.."
echo "-=-=-=-=-=-=-=-=-=-=-=-="

set /p Project="Enter Project ID : " %=%

echo off
echo "Using Keystore for "
echo %Project%
echo "-=-=-=-=-"

"C:\Program Files (x86)\Java\jre6\bin\keytool" -genkey -alias "%Project%.keystore" -keyalg RSA -validity 20000 -keystore Z:\GameDev\PC\myAndroidKeystore.keystore

echo "-=-=-=-=-"
echo "^ Created Keystore Certificate ^"
echo "-=-=-=-=-"

"C:\Program Files (x86)\Java\jdk1.6.0_45\bin\jarsigner" -verbose -keystore Z:\GameDev\PC\myAndroidKeystore.keystore -signedjar "%Project%-signed.apk" MonkeyGame-debug.apk "%Project%.keystore"

echo "-=-=-=-=-"
echo "^ Signed apk ^"
echo "-=-=-=-=-"

"C:\DevTools\AndroidSDK\build-tools\23.0.3\zipalign" -v 4 "%Project%-signed.apk" "%Project%-signed-zipped.apk"
echo "-=-=-=-=-"
echo "^ ZipAligned apk, whatever that means ^"
echo "-=-=-=-=-"

echo "CHECK"

"C:\Program Files (x86)\Java\jdk1.6.0_45\bin\jarsigner" -verify -verbose -certs "%Project%-signed-zipped.apk" >out.txt

rename MonkeyGame-debug.apk oldMonkeyGame-debug.apk

copy %Project%-signed-zipped.apk %Project%-signed-zipped_copy.apk

rename %Project%-signed-zipped_copy.apk MonkeyGame-debug.apk
echo "Finish..."
It seems to work, but when I upload the aligned/zipped apk file, it still says it's a debuggable APK :( And says I need to disable debugging.

Feel like I'm running in circles.
I'll post the log for running the script above anyway in hopes that someone spots what I might be missing:
Code: [Select]
Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\temp>echo off
"-=-=-=-=-=-=-=-=-=-=-=-="
"REMINDER"
"    Be sure you're using"
"    Java 6, NOT Java 7.."
"-=-=-=-=-=-=-=-=-=-=-=-="
Enter Project ID : Spacewhale
"Using Keystore for "
Spacewhale
"-=-=-=-=-"
Enter keystore password:
keytool error: java.lang.Exception: Key pair not generated, alias <Spacewhale.keystore> already exists
"-=-=-=-=-"
"^ Created Keystore Certificate ^"
"-=-=-=-=-"
Enter Passphrase for keystore:
   adding: META-INF/MANIFEST.MF
   adding: META-INF/SPACEWHA.SF
   adding: META-INF/SPACEWHA.RSA
  signing: AndroidManifest.xml
  signing: assets/monkey/Pickup_Coin.ogg
  signing: assets/monkey/Pickup_Coin_slow.ogg
  signing: assets/monkey/alarm.ogg
  signing: assets/monkey/ambient01.ogg
  signing: assets/monkey/ambient01_slow.ogg
  signing: assets/monkey/ambient02.ogg
  signing: assets/monkey/ambient02_slow.ogg
  signing: assets/monkey/ambient03.ogg
  signing: assets/monkey/ambient03_slow.ogg
  signing: assets/monkey/beCareful.ogg
  signing: assets/monkey/blitzfont20.png
  signing: assets/monkey/bomb.ogg
  signing: assets/monkey/bombRetrieved.ogg
  signing: assets/monkey/bomb_slow.ogg
  signing: assets/monkey/boss.ogg
  signing: assets/monkey/coinCollected.ogg
  signing: assets/monkey/complete.ogg
  signing: assets/monkey/destructomatic.ogg
  signing: assets/monkey/detectingActivityAhead.ogg
  signing: assets/monkey/enemySFX01.ogg
  signing: assets/monkey/enemySFX02.ogg
  signing: assets/monkey/enemySFX03.ogg
  signing: assets/monkey/enemySFX04.ogg
  signing: assets/monkey/enemySFX05.ogg
  signing: assets/monkey/enemySystemWeakened.ogg
  signing: assets/monkey/enemyTakeHit.ogg
  signing: assets/monkey/enemyTakeHit02.ogg
  signing: assets/monkey/enemyTakeHit02_slow.ogg
  signing: assets/monkey/enemyTakeHit03.ogg
  signing: assets/monkey/enemyTakeHit03_slow.ogg
  signing: assets/monkey/enemyTakeHit_slow.ogg
  signing: assets/monkey/environment.png
  signing: assets/monkey/explode01.ogg
  signing: assets/monkey/explode01_slow.ogg
  signing: assets/monkey/explode02.ogg
  signing: assets/monkey/explode02_slow.ogg
  signing: assets/monkey/fog.png
  signing: assets/monkey/fog2.png
  signing: assets/monkey/fuel.ogg
  signing: assets/monkey/fuel_slow.ogg
  signing: assets/monkey/game-over.ogg
  signing: assets/monkey/gameOver.ogg
  signing: assets/monkey/getReady.ogg
  signing: assets/monkey/homingMissiles.ogg
  signing: assets/monkey/invulnerability.ogg
  signing: assets/monkey/invulnerability_slow.ogg
  signing: assets/monkey/level1.ogg
  signing: assets/monkey/level1.png
  signing: assets/monkey/level1Enemies.png
  signing: assets/monkey/level2.png
  signing: assets/monkey/level2Enemies.png
  signing: assets/monkey/level3.png
  signing: assets/monkey/level3Enemies.png
  signing: assets/monkey/level4.png
  signing: assets/monkey/level4Enemies.png
  signing: assets/monkey/level5.png
  signing: assets/monkey/level5Enemies.png
  signing: assets/monkey/level6.png
  signing: assets/monkey/maydayMayday.ogg
  signing: assets/monkey/menu.ogg
  signing: assets/monkey/menu.png
  signing: assets/monkey/menuBG.png
  signing: assets/monkey/menuBG2.png
  signing: assets/monkey/menuBG3.png
  signing: assets/monkey/missiles.ogg
  signing: assets/monkey/missionComplete.ogg
  signing: assets/monkey/mojo_font.png
  signing: assets/monkey/money.ogg
  signing: assets/monkey/money_slow.ogg
  signing: assets/monkey/move.ogg
  signing: assets/monkey/myNameIsTrixie.ogg
  signing: assets/monkey/newShipPurchase.ogg
  signing: assets/monkey/objectiveComplete.ogg
  signing: assets/monkey/pickingUpAnomalies.ogg
  signing: assets/monkey/planetDestroyed.ogg
  signing: assets/monkey/promoted.ogg
  signing: assets/monkey/scanlines.png
  signing: assets/monkey/select.ogg
  signing: assets/monkey/sheet.png
  signing: assets/monkey/shield.ogg
  signing: assets/monkey/shieldRestored.ogg
  signing: assets/monkey/shield_slow.ogg
  signing: assets/monkey/ship-select.ogg
  signing: assets/monkey/shipLost.ogg
  signing: assets/monkey/shipReadyToEngage.ogg
  signing: assets/monkey/shoot01.ogg
  signing: assets/monkey/shoot01_slow.ogg
  signing: assets/monkey/shoot02.ogg
  signing: assets/monkey/shoot02_slow.ogg
  signing: assets/monkey/shoot03.ogg
  signing: assets/monkey/shoot03_slow.ogg
  signing: assets/monkey/shoot04.ogg
  signing: assets/monkey/shoot04_slow.ogg
  signing: assets/monkey/shoot05.ogg
  signing: assets/monkey/shoot05_slow.ogg
  signing: assets/monkey/shootDropsToCycleBetweenThem.ogg
  signing: assets/monkey/speed.ogg
  signing: assets/monkey/speedAtMax.ogg
  signing: assets/monkey/speedUp.ogg
  signing: assets/monkey/speed_slow.ogg
  signing: assets/monkey/statsBG.png
  signing: assets/monkey/takeHit.ogg
  signing: assets/monkey/takeHit_slow.ogg
  signing: assets/monkey/thisIsAsDeepAsWeCanGo.ogg
  signing: assets/monkey/upgradeShipUsingEnemyDrops.ogg
  signing: assets/monkey/upgradeWeaponOnNextStage.ogg
  signing: assets/monkey/useSlowDownWhenTooCrazy.ogg
  signing: assets/monkey/warning.ogg
  signing: assets/monkey/watchOut.ogg
  signing: assets/monkey/weHaveAProblem.ogg
  signing: assets/monkey/weapon.ogg
  signing: assets/monkey/weaponAtMax.ogg
  signing: assets/monkey/weaponUpgrade.ogg
  signing: assets/monkey/weapon_slow.ogg
  signing: assets/monkey/yourRaceThanksYou.ogg
  signing: res/drawable-hdpi-v4/icon.png
  signing: res/drawable-ldpi-v4/icon.png
  signing: res/drawable-mdpi-v4/icon.png
  signing: res/layout/main.xml
  signing: resources.arsc
  signing: classes.dex
  signing: lib/mips/liblangutil.so
  signing: lib/armeabi/libnativegl.so
  signing: lib/armeabi/liblangutil.so
  signing: lib/x86/libnativegl.so
  signing: lib/x86/liblangutil.so
  signing: lib/armeabi-v7a/libnativegl.so
  signing: lib/armeabi-v7a/liblangutil.so
"-=-=-=-=-"
"^ Signed apk ^"
"-=-=-=-=-"
Verifying alignment of Spacewhale-signed-zipped.apk (4)...
      50 META-INF/MANIFEST.MF (OK - compressed)
    4163 META-INF/SPACEWHA.SF (OK - compressed)
    8348 META-INF/SPACEWHA.RSA (OK - compressed)
    9085 AndroidManifest.xml (OK - compressed)
   10224 assets/monkey/Pickup_Coin.ogg (OK)
   19488 assets/monkey/Pickup_Coin_slow.ogg (OK)
   32108 assets/monkey/alarm.ogg (OK)
   72496 assets/monkey/ambient01.ogg (OK)
  119776 assets/monkey/ambient01_slow.ogg (OK)
  183260 assets/monkey/ambient02.ogg (OK)
  231884 assets/monkey/ambient02_slow.ogg (OK)
  296604 assets/monkey/ambient03.ogg (OK)
  376356 assets/monkey/ambient03_slow.ogg (OK)
  479800 assets/monkey/beCareful.ogg (OK)
  490304 assets/monkey/blitzfont20.png (OK)
  498152 assets/monkey/bomb.ogg (OK)
  509184 assets/monkey/bombRetrieved.ogg (OK)
  521632 assets/monkey/bomb_slow.ogg (OK)
  536732 assets/monkey/boss.ogg (OK)
 2724140 assets/monkey/coinCollected.ogg (OK)
 2737440 assets/monkey/complete.ogg (OK)
 6634876 assets/monkey/destructomatic.ogg (OK)
 6651456 assets/monkey/detectingActivityAhead.ogg (OK)
 6670312 assets/monkey/enemySFX01.ogg (OK)
 6682440 assets/monkey/enemySFX02.ogg (OK)
 6689124 assets/monkey/enemySFX03.ogg (OK)
 6695812 assets/monkey/enemySFX04.ogg (OK)
 6704684 assets/monkey/enemySFX05.ogg (OK)
 6710288 assets/monkey/enemySystemWeakened.ogg (OK)
 6727400 assets/monkey/enemyTakeHit.ogg (OK)
 6734372 assets/monkey/enemyTakeHit02.ogg (OK)
 6740232 assets/monkey/enemyTakeHit02_slow.ogg (OK)
 6746400 assets/monkey/enemyTakeHit03.ogg (OK)
 6756404 assets/monkey/enemyTakeHit03_slow.ogg (OK)
 6767536 assets/monkey/enemyTakeHit_slow.ogg (OK)
 6775264 assets/monkey/environment.png (OK)
 6816608 assets/monkey/explode01.ogg (OK)
 6838932 assets/monkey/explode01_slow.ogg (OK)
 6867060 assets/monkey/explode02.ogg (OK)
 6897456 assets/monkey/explode02_slow.ogg (OK)
 6937132 assets/monkey/fog.png (OK)
 6995584 assets/monkey/fog2.png (OK)
 7023824 assets/monkey/fuel.ogg (OK)
 7043196 assets/monkey/fuel_slow.ogg (OK)
 7069016 assets/monkey/game-over.ogg (OK)
 7144616 assets/monkey/gameOver.ogg (OK)
 7222652 assets/monkey/getReady.ogg (OK)
 7232492 assets/monkey/homingMissiles.ogg (OK)
 7247608 assets/monkey/invulnerability.ogg (OK)
 7261548 assets/monkey/invulnerability_slow.ogg (OK)
 7278200 assets/monkey/level1.ogg (OK)
12970636 assets/monkey/level1.png (OK)
13087240 assets/monkey/level1Enemies.png (OK)
13261364 assets/monkey/level2.png (OK)
13337896 assets/monkey/level2Enemies.png (OK)
13395928 assets/monkey/level3.png (OK)
13467100 assets/monkey/level3Enemies.png (OK)
13553428 assets/monkey/level4.png (OK)
13651696 assets/monkey/level4Enemies.png (OK)
13731644 assets/monkey/level5.png (OK)
13818408 assets/monkey/level5Enemies.png (OK)
13857816 assets/monkey/level6.png (OK)
13924800 assets/monkey/maydayMayday.ogg (OK)
13940412 assets/monkey/menu.ogg (OK)
19576352 assets/monkey/menu.png (OK)
19651992 assets/monkey/menuBG.png (OK)
19654992 assets/monkey/menuBG2.png (OK)
19657236 assets/monkey/menuBG3.png (OK)
19659832 assets/monkey/missiles.ogg (OK)
19672156 assets/monkey/missionComplete.ogg (OK)
19687088 assets/monkey/mojo_font.png (OK)
19689228 assets/monkey/money.ogg (OK)
19700608 assets/monkey/money_slow.ogg (OK)
19714568 assets/monkey/move.ogg (OK)
19728032 assets/monkey/myNameIsTrixie.ogg (OK)
19754168 assets/monkey/newShipPurchase.ogg (OK)
19769496 assets/monkey/objectiveComplete.ogg (OK)
19785048 assets/monkey/pickingUpAnomalies.ogg (OK)
19802208 assets/monkey/planetDestroyed.ogg (OK)
19816848 assets/monkey/promoted.ogg (OK)
19826940 assets/monkey/scanlines.png (OK)
19886200 assets/monkey/select.ogg (OK)
19892744 assets/monkey/sheet.png (OK)
19991360 assets/monkey/shield.ogg (OK)
20013524 assets/monkey/shieldRestored.ogg (OK)
20027040 assets/monkey/shield_slow.ogg (OK)
20059120 assets/monkey/ship-select.ogg (OK)
21247800 assets/monkey/shipLost.ogg (OK)
21263796 assets/monkey/shipReadyToEngage.ogg (OK)
21280980 assets/monkey/shoot01.ogg (OK)
21288796 assets/monkey/shoot01_slow.ogg (OK)
21306296 assets/monkey/shoot02.ogg (OK)
21313128 assets/monkey/shoot02_slow.ogg (OK)
21321152 assets/monkey/shoot03.ogg (OK)
21328640 assets/monkey/shoot03_slow.ogg (OK)
21337156 assets/monkey/shoot04.ogg (OK)
21343612 assets/monkey/shoot04_slow.ogg (OK)
21351096 assets/monkey/shoot05.ogg (OK)
21359400 assets/monkey/shoot05_slow.ogg (OK)
21369240 assets/monkey/shootDropsToCycleBetweenThem.ogg (OK)
21393428 assets/monkey/speed.ogg (OK)
21414124 assets/monkey/speedAtMax.ogg (OK)
21428116 assets/monkey/speedUp.ogg (OK)
21438768 assets/monkey/speed_slow.ogg (OK)
21463876 assets/monkey/statsBG.png (OK)
21483800 assets/monkey/takeHit.ogg (OK)
21495540 assets/monkey/takeHit_slow.ogg (OK)
21509644 assets/monkey/thisIsAsDeepAsWeCanGo.ogg (OK)
21530348 assets/monkey/upgradeShipUsingEnemyDrops.ogg (OK)
21555940 assets/monkey/upgradeWeaponOnNextStage.ogg (OK)
21572204 assets/monkey/useSlowDownWhenTooCrazy.ogg (OK)
21601568 assets/monkey/warning.ogg (OK)
21610748 assets/monkey/watchOut.ogg (OK)
21622368 assets/monkey/weHaveAProblem.ogg (OK)
21636144 assets/monkey/weapon.ogg (OK)
21651432 assets/monkey/weaponAtMax.ogg (OK)
21665012 assets/monkey/weaponUpgrade.ogg (OK)
21677744 assets/monkey/weapon_slow.ogg (OK)
21698316 assets/monkey/yourRaceThanksYou.ogg (OK)
21714520 res/drawable-hdpi-v4/icon.png (OK)
21724484 res/drawable-ldpi-v4/icon.png (OK)
21727776 res/drawable-mdpi-v4/icon.png (OK)
21732994 res/layout/main.xml (OK - compressed)
21733368 resources.arsc (OK)
21734593 classes.dex (OK - compressed)
21883233 lib/mips/liblangutil.so (OK - compressed)
21884860 lib/armeabi/libnativegl.so (OK - compressed)
21890250 lib/armeabi/liblangutil.so (OK - compressed)
21895853 lib/x86/libnativegl.so (OK - compressed)
21897237 lib/x86/liblangutil.so (OK - compressed)
21898979 lib/armeabi-v7a/libnativegl.so (OK - compressed)
21904377 lib/armeabi-v7a/liblangutil.so (OK - compressed)
Verification succesful
"-=-=-=-=-"
"^ ZipAligned apk, whatever that means ^"
"-=-=-=-=-"
"CHECK"
        1 file(s) copied.
"Finish..."
Retro gaming fan and maker sometimes...

Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Re: Uploading .apk file to Google play console
« Reply #3 on: January 22, 2018, 01:00:38 AM »
Thought I'd make it clear, that despite the "success" I have in creating the apk and signing and zip aligning it, Google still seems to think it's a debug apk and not a release apk. Could I load the Monkey generated Java code into some other editor (perhaps Android studio?) and sign it that way? I'm not sure how I would proceed from there though...
Retro gaming fan and maker sometimes...

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 295
Re: Uploading .apk file to Google play console
« Reply #4 on: January 24, 2018, 10:18:28 AM »
Try replacing this line in your manifest:

Code: [Select]
<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon">

with

Code: [Select]
<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon" android:debuggable="false">

Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Re: Uploading .apk file to Google play console
« Reply #5 on: January 24, 2018, 12:41:14 PM »
Try replacing this line in your manifest:

Code: [Select]
<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon">

with

Code: [Select]
<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon" android:debuggable="false">

Hi Xaron,

Thanks for your response. I'm not sure exactly when to do this. Some questions:
1. If I build the apk, try modify the AndroidManifest.xml in the buildfolder/android_new/bin, the apk is already built, so how will this help?
2. If I open the AndroidManifest.xml inside the opened apk, the file seems to be binary, so surely cannot modify it in there?
3. Can I not add a line in my monkey code as such?
Code: [Select]
#ANDROID_APP_LABEL = "Spacewhale"
#ANDROID_APP_PACKAGE = "com.blackjet.Spacewhale"
#ANDROID_SCREEN_ORIENTATION = "landscape"
#ANDROID_NATIVE_GL_ENABLED = True
#ANDROID_GAMEPAD_ENABLED = True
#ANDROID_MANIFEST_MAIN += "<uses-permission android:name=~qandroid.permission.VIBRATE~q />"

' This is the new one
#ANDROID_DEBUGGABLE = False

I'm not sure how any of you monkey users have managed to get their games onto google playstore and not come across this issue?
I'm sorry if I sound like I'm being stupid Xaron, but a little more detail as to where and and what stage to add that parameter in the AndroidManifest.xml would be hugely helpful.

Thanks!

========EDIT========
Just found #ANDROID_SIGN_APP=False in the CONFIG.MONKEY file in the buildfolder/android_new path. I'll add that to my game android code and see if setting that to either true or false will help.

=======EDIT 2========
Ok I think I've started making some progress:
Code: [Select]
...<snip>
-package-resources:
     [aapt] Creating full resource package...
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating MonkeyGame-release-unsigned.apk for release...
BUILD FAILED
C:\DevTools\AndroidSDK\tools\ant\build.xml:1135: The following error occurred while executing this line:
C:\DevTools\AndroidSDK\tools\ant\build.xml:1147: Z:\GameDev\PC\SpaceWhale\release-key.keystore (The system cannot find the file specified)

This seems like a chicken and egg situation now. I have to build the apk to get my icons and settings in to create a keystore file (via my batch script file), but I also need a keystore file to build!?!?!
Retro gaming fan and maker sometimes...

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: Uploading .apk file to Google play console
« Reply #6 on: January 24, 2018, 12:53:25 PM »
Not perfectly suiting but couldn't you use Android Studio to compile the "converted to java"-monkey-code?


http://evolvingdeveloper.com/guide-to-building-a-monkey-x-game-to-android/




Dunno if this is still valid for Monkey-X - a pity the thread for this is already gone:
MyGame\MyGame.build\android\AndroidManifest.xml
is your individual settings file, but you can also do it in the template file
MyGame\MyGame.build\android\templates\AndroidManifest.xml


In my Apes-Banana-Conquest folder the template starts with this:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="${ANDROID_APP_PACKAGE}"
android:versionCode="${ANDROID_VERSION_CODE}"
android:versionName="${ANDROID_VERSION_NAME}"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="7" />

<uses-feature android:glEsVersion="0x00010001" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />

${ANDROID_MANIFEST_MAIN}

<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon">

the last line is what Xaron suggested to modify.


The "final" one (might be in another directory than on my v82 variant - used the "free version" that time) contained this then
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.digidea.apesbananaconquest"
android:versionCode="0"
android:versionName="0.1"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="7" />

<uses-feature android:glEsVersion="0x00010001" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />




<application android:label="Ape's Banana Conquest" android:icon="@drawable/icon">
So you see, it corresponds to the template-Manifest file.


If you write it in the template file I think you must rebuild your project.


bye
Ron



Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Re: Uploading .apk file to Google play console
« Reply #7 on: January 24, 2018, 01:05:36 PM »
Thanks for your suggestions Ron!

The config.monkey file has the following in place:
Code: [Select]
#ANDROID_KEY_STORE="../../release-key.keystore"
#ANDROID_KEY_ALIAS="release-key-alias"
#ANDROID_KEY_STORE_PASSWORD="password"
#ANDROID_KEY_ALIAS_PASSWORD="password"
#ANDROID_SIGN_APP=False

I think what I'll try next is to build it for debug as per normal, run my batch script to create the keystore file. Then I'll add the params from above into my android game code section adn change the paths and passwords etc to what I made for debug run. Then change ANDROID_SIGN_APP to true again and see how that goes. I'll let you know!
Retro gaming fan and maker sometimes...

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: Uploading .apk file to Google play console
« Reply #8 on: January 24, 2018, 01:09:41 PM »
These config values are surely used to replace the placeholders in the AndroidManifest.xml and other locations.

But there is no placeholder defined for the "debuggable" part in the template - because the template part is not existing yet. Which seems to be why you need to add it manually to "template/AndroidManifest.xml"


Dunno if Xaron's/Mike's Cerberus handles this already, if not they should consider adding it so to make debug/release reachable via config (or better: via IDE compiler switch).

bye
Ron

Offline jvdw007

  • Jr. Member
  • **
  • Posts: 30
    • Blackjet Games
Re: Uploading .apk file to Google play console
« Reply #9 on: January 24, 2018, 01:38:59 PM »
Ok guys, great news! I was right in the end.
A simpler method (well at least for me) was to do this:

In my #If TARGET = "android" code of my game, I added this:
Code: [Select]
' Release build stuff
#ANDROID_KEY_STORE = "../../../android-release-key.keystore"
#ANDROID_KEY_ALIAS = "Spacewhale.keystore"
#ANDROID_KEY_STORE_PASSWORD = "password"
#ANDROID_KEY_ALIAS_PASSWORD = "password"
#ANDROID_SIGN_APP = True

Initially, I set the ANDROID_SIGN_APP to False. I then built the usual debug version of the game. I then pulled out the META_INF folder in the .apk file. I then copied that .apk and my batch script file to a temp folder in the /bin folder that was built.
I then filled in the approriate info like my OU details, my name, passwords etc etc. This then generated my .keystore file in another folder I specified in the batch script. I then took those details and placed it in the above android code as can be seen.
I then built it again in Mollusk with #ANDROID_SIGN_APP = True set, and this is what log output I got.
Code: [Select]
TRANS monkey compiler V1.87
Parsing...
Semanting...
Translating...
Building...
Buildfile: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\build.xml
-check-env:
 [checkenv] Android SDK Tools Revision 25.2.5
 [checkenv] Installed at C:\DevTools\AndroidSDK
-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application
-pre-clean:
clean:
   [delete] Deleting directory Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin
   [delete] Deleting directory Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
   [subant] No sub-builds to iterate on
BUILD SUCCESSFUL
Total time: 35 seconds
Buildfile: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\build.xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
     [echo] proguard.config is ${proguard.config}
-pre-build:
-check-env:
 [checkenv] Android SDK Tools Revision 25.2.5
 [checkenv] Installed at C:\DevTools\AndroidSDK
-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application
-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.3
     [echo] Resolving Build Target for MonkeyGame...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\rsObj
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\rsLibs
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\gen
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\classes
    [mkdir] Created dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for MonkeyGame...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'release'...
   [subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
    [javac] Compiling 5 source files to Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\classes
    [javac] Note: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\src\com\blackjet\Spacewhale\MonkeyGame.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\src\com\blackjet\Spacewhale\MonkeyGame.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
-post-compile:
-obfuscate:
-dex:
      [dex] input: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\classes
      [dex] Converting compiled files and external libraries into Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\classes.dex...
-crunch:
   [crunch] Crunching PNG Files in source dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\res
   [crunch] To destination dir: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res
   [crunch] Processing image to cache: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\res\drawable-hdpi\icon.png => Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-hdpi\icon.png
   [crunch]   (processed image to cache entry Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-hdpi\icon.png: 82% size of source)
   [crunch] Processing image to cache: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\res\drawable-ldpi\icon.png => Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-ldpi\icon.png
   [crunch]   (processed image to cache entry Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-ldpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\res\drawable-mdpi\icon.png => Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-mdpi\icon.png
   [crunch]   (processed image to cache entry Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\res\drawable-mdpi\icon.png: 78% size of source)
   [crunch] Crunched 3 PNG files to update cache
-package-resources:
     [aapt] Creating full resource package...
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating MonkeyGame-release-unsigned.apk for release...
-post-package:
-release-prompt-for-password:
-release-nosign:
-release-sign:
     [echo] Signing final apk...
 [zipalign] Running zip align on final apk...
     [echo] Release Package: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\MonkeyGame-release.apk
[propertyfile] Creating new property file: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\build.prop
[propertyfile] Updating property file: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\build.prop
[propertyfile] Updating property file: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\build.prop
[propertyfile] Updating property file: Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\build.prop
-post-build:
release:
install:
     [echo] Installing Z:\GameDev\PC\SpaceWhale\spacewhale.buildv86e\android_new\bin\MonkeyGame-release.apk onto default emulator or device...

As can be seen, it built a signed .apk correctly. I opened the .apk to ensure my icons are in etc. I then went to the google play console and uploaded this .apk and it was accepted!

To me, this is an easy method to ensure you can build both debug and proper release versions by simply changing one android parameter.

Hope this helps others!
I just wish the -config=release/debug parameter for transcc actually did what it was supposed to do!
Retro gaming fan and maker sometimes...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal