ZGameEditor & Android Setting
Moderator: Moderators
Android SDK compiler has already done it for you. Just visit the generated bin folder. It contains a file named <app name>-debug.apk.
BTW if you are developing for OUYA, there's a new video tutorial for OUYA controller, see https://www.youtube.com/watch?v=99y2JBY ... Oz_qaU634A It contains also the description of the building and installation process.
BTW if you are developing for OUYA, there's a new video tutorial for OUYA controller, see https://www.youtube.com/watch?v=99y2JBY ... Oz_qaU634A It contains also the description of the building and installation process.
Re: ZGameEditor & Android Setting
Hi, I'm currently pushing Omeganaut to Google Play, and I must say that I'll have a little problem by the end of the month:
Or do I have something to set up in the magical AndroidManifest.xml file?
Does that mean that ZGE should update the compilation version to 26 instead of 16?Target API level requirements from August 2018
Warning:
Your app currently targets API level 16 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance.
From August 2018, new apps must target at least Android 8.0 (API level 26).
From November 2018, app updates must target Android 8.0 (API level 26).
Or do I have something to set up in the magical AndroidManifest.xml file?
Re: ZGameEditor & Android Setting
Hi, I was not aware of this
.
Perhaps it is enough to manually edit the AndroidManifest.xml file and set minSdkVersion to "26"?
![Smile :)](./images/smilies/icon_smile.gif)
Perhaps it is enough to manually edit the AndroidManifest.xml file and set minSdkVersion to "26"?
Re: ZGameEditor & Android Setting
The problem is if I just change minSdkVersion to 26, the game won't run on "old" phones. And if I push that to the play store, I won't be able to go back afterwards. I already had that problem with another game. Here's what I need to do:
But ZGE rewrites AndroidManifest.xml file when compiling, so it removes my precious lines. I tried to convert that file to read only, but then it won't compile. What should I do?
Edit:
So I tried to replace the AndroidManifest.xml afterwards, using:
I just need ZGE to not touch AndroidManifest while building the apk.
Edit 2:
One last test before going to bed. I can't go to sleep after such a defeat.
And I managed to change my line!!! The problem was coming from another little change in the manifest:
Replacing only <uses-sdk android:minSdkVersion="16" /> by <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" /> works.
But I was also replacing android:screenOrientation="landscape" by android:screenOrientation="sensorLandscape", and that one triggered the replacement of my manifest by a new one made by ZGE.
Maybe ZGE is detecting that this parameter is different from the one selected in the build window?
![Image](http://i63.tinypic.com/x1eqoj.png)
VilleK, if that's the case, can you add sensorLandscape to the options?
Code: Select all
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
Edit:
So I tried to replace the AndroidManifest.xml afterwards, using:
- Decompile: java -jar /usr/local/bin/apktool.jar decode Omeganaut.apk -o app -f
- Replace AndroidManifest.xml
- Compile: java -jar /usr/local/bin/apktool.jar build app -o Omeganaut_new.apk
- Sign APK: jarsigner -verbose -keystore KEY.keystore Omeganaut_new.apk NAME
- Align APK: zipalign -f -v 4 Omeganaut_new.apk Omeganaut_aligned.apk
I spent all day trying to do add android:targetSdkVersion="26" to the apk, I'm a bit fed up...You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: ERROR (Jar signer NAME.RSA): JAR signature META-INF/NAME.RSA uses digest algorithm SHA-256 and signature algorithm RSA which is not supported on API Level(s) 16-17 for which this APK is being verified
I just need ZGE to not touch AndroidManifest while building the apk.
Edit 2:
One last test before going to bed. I can't go to sleep after such a defeat.
And I managed to change my line!!! The problem was coming from another little change in the manifest:
Replacing only <uses-sdk android:minSdkVersion="16" /> by <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" /> works.
But I was also replacing android:screenOrientation="landscape" by android:screenOrientation="sensorLandscape", and that one triggered the replacement of my manifest by a new one made by ZGE.
Maybe ZGE is detecting that this parameter is different from the one selected in the build window?
![Image](http://i63.tinypic.com/x1eqoj.png)
VilleK, if that's the case, can you add sensorLandscape to the options?
Re: ZGameEditor & Android Setting
And it's getting worse...
With <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" /> the ClearColor doesn't seem to work anymore and gives me a white screen instead of a black one...
![Image](http://i63.tinypic.com/14dhved.png)
Also, the Store only allows the game on a very few number of devices (mines are not included, classic), because it says that:
So with low_latency on, it runs only on 2814 devices.
When that line is removed, it runs on 14324 devices (including mines, such as old Galaxy S6).
What is the purpose of android.hardware.audio.low_latency for ZGE?
Edit:
And I can't roll back to minSdkVersion="16"... I should have seen that coming....
Edit 2:
By pure luck, the black background is back on target 23, the low latency is deactivated but everything seems to work, and Google Play is finally willing to take my apk. I've been on that since 9AM. It's now almost 3AM. Yeah google... And I'll still have to update to target 26 by november 2018. Countdown is ticking![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
With <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" /> the ClearColor doesn't seem to work anymore and gives me a white screen instead of a black one...
![Image](http://i63.tinypic.com/14dhved.png)
Also, the Store only allows the game on a very few number of devices (mines are not included, classic), because it says that:
Without more explanations.Doesn't support required feature <uses-feature>
- android.hardware.audio.low_latency
So with low_latency on, it runs only on 2814 devices.
When that line is removed, it runs on 14324 devices (including mines, such as old Galaxy S6).
What is the purpose of android.hardware.audio.low_latency for ZGE?
Edit:
And I can't roll back to minSdkVersion="16"... I should have seen that coming....
Problem:
Users that have the APK with version code 180710, which targets SDK 23 or higher, will receive an error when they attempt to upgrade to this APK because it targets SDK 16.
Resolution:
Ensure that your release includes APKs targeting SDK 23 or higher to which all users that have the APK with version code 180710 can upgrade.
Edit 2:
By pure luck, the black background is back on target 23, the low latency is deactivated but everything seems to work, and Google Play is finally willing to take my apk. I've been on that since 9AM. It's now almost 3AM. Yeah google... And I'll still have to update to target 26 by november 2018. Countdown is ticking
![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
Re: ZGameEditor & Android Setting
Sorry you are having such a struggle with this. Its been a while since I did any Android development so I don't have any current knowledge I'm afraid. But if you manually edit the xml-file then there should be a m.bat file in the project path that you can use to rebuild the apk? The apk is a zip file but it must be digitally signed and encrypted to work on actual device, the m.bat should take care of that unless I remember incorrectly.
Re: ZGameEditor & Android Setting
Thanks VilleK. I didn't think about that folder. And I just discovered the file Library.xml too ![Embarassed :oops:](./images/smilies/icon_redface.gif)
Is it possible that you add a "custom" option to line 1273 in ZApplication.pas ?
so one can add a "custom" folder in ZGameEditor/Android/Template and mess around with the parameters without touching base or 4.1 folders' settings
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Is it possible that you add a "custom" option to line 1273 in ZApplication.pas ?
Code: Select all
{$ifndef minimal}List.GetLast.SetOptions(['2.2 (API Level 8)','4.1 (API Level 16)']);
Re: ZGameEditor & Android Setting
After ZGE copied the template files to your project folder it should not overwrite them again if you have modified the files. So you should be able to experiment in your project folder? If you find settings that work with API level 23 then let me know and I'll make a template folder for that.
Re: ZGameEditor & Android Setting
No. As I told two days ago, there are some options that you can change in the manifest, and some others that you can't, otherwise it triggers the replacement of the project files by the template files.
For instance:
replacing
android:screenOrientation="landscape" >
by
android:screenOrientation="sensorLandscape" >
Also I've compiled to target 23 in order to make it available on Google Play. But I think I'll try to make target 26 works instead, since it will be the new requirement by next month:
For instance:
replacing
android:screenOrientation="landscape" >
by
android:screenOrientation="sensorLandscape" >
Also I've compiled to target 23 in order to make it available on Google Play. But I think I'll try to make target 26 works instead, since it will be the new requirement by next month:
From August 2018, new apps must target at least Android 8.0 (API level 26).
From November 2018, app updates must target Android 8.0 (API level 26).
Re: ZGameEditor & Android Setting
Debugging that kind of stuff is not my thing, so I have to read a lot of stuff online and I'm advancing very slowly
Here's my little progress:
When compiled to target API 23, the apk crashes on recent phones (ex: Nokia 6.1, Huawei Honor View 10) with this log:
When compiled to target API 26, the apk is behaving weird on "old" phones (see above screenshot: viewtopic.php?p=8746#p8738)
https://developer.android.com/about/ver ... ndroid-7.0
On recent phones, target API 26 will just close the apk at launch, without a crash log.
![Laughing :lol:](./images/smilies/icon_lol.gif)
Here's my little progress:
When compiled to target API 23, the apk crashes on recent phones (ex: Nokia 6.1, Huawei Honor View 10) with this log:
Code: Select all
java.lang.UnsatisfiedLinkError:
at java.lang.Runtime.loadLibrary0 (Runtime.java:1016)
at java.lang.System.loadLibrary (System.java:1657)
at org.zgameeditor.Zge.<init> (Zge.java:78)
at org.zgameeditor.ZgeActivity.onCreate (ZgeActivity.java:48)
at android.app.Activity.performCreate (Activity.java:7036)
at android.app.Activity.performCreate (Activity.java:7027)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1589)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6501)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)
- Light is overexposed on 3d models
- ClearColor background is pure white
- Sprites particles and fonts are OK
- Models with materials and bitmap textures will appear ok, depending on the texture.
In the ZPong.zgeproj example, only the bars are ok. The ball is pure white.
https://developer.android.com/about/ver ... ndroid-7.0
On recent phones, target API 26 will just close the apk at launch, without a crash log.
Re: ZGameEditor & Android Setting
Debugging on Android is indeed very difficult
. I guess that before you get that exception there is shown some other message in the android log that explains why the library cannot be loaded. Can you debug and display the android log? The "r.bat" file in the project folder used to do that, iirc.
![Smile :)](./images/smilies/icon_smile.gif)
Re: ZGameEditor & Android Setting
So I started a list of the tested devices so I can try to find why it is working, or not. It appears that it is working mainly on my phone...
https://docs.google.com/spreadsheets/d/ ... sp=sharing
And I managed to resurect an old Sony Xperia Z3 compact where the game crashes. Here's the log:
https://docs.google.com/spreadsheets/d/ ... sp=sharing
And I managed to resurect an old Sony Xperia Z3 compact where the game crashes. Here's the log:
build.board: MSM8974
build.bootloader: s1
build.brand: Sony
build.cpu_abi: armeabi-v7a
build.cpu_abi2: armeabi
build.device: D5803
build.display: 23.5.A.1.291
build.fingerprint: Sony/D5803/D5803:6.0.1/23.5.A.1.291/2769308465:user/release-keys
build.hardware: qcom
build.host: BuildHost
build.id: 23.5.A.1.291
build.manufacturer: Sony
build.model: D5803
build.product: D5803
build.radio: unknown
build.serial: YT91124MHY
build.tags: release-keys
build.time: 1467083751000
build.type: user
build.user: BuildUser
version.codename: REL
version.incremental: 2769308465
version.release: 6.0.1
version.sdk_int: 23
07-10 20:20:01.096 I/Timeline(3464): Timeline: Activity_launch_request id:com.txori.omeganaut_debug time:5828423
07-10 20:20:01.097 I/ActivityManager(928): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.txori.omeganaut_debug/org.zgameeditor.ZgeActivity bnds=[538,814][716,1002]} from uid 10106 on display 0
07-10 20:20:01.143 I/ActivityManager(928): Start proc 23499:com.txori.omeganaut_debug/u0a237 for activity com.txori.omeganaut_debug/org.zgameeditor.ZgeActivity
07-10 20:20:01.327 E/linker (23499): /data/app/com.txori.omeganaut_debug-1/lib/arm/libzgeandroid.so: has text relocations
07-10 20:20:01.330 E/AndroidRuntime(23499): Process: com.txori.omeganaut_debug, PID: 23499
07-10 20:20:01.330 E/AndroidRuntime(23499): java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.txori.omeganaut_debug-1/lib/arm/libzgeandroid.so: has text relocations
07-10 20:20:01.332 D/ActivityManager(928): New dropbox entry: com.txori.omeganaut_debug, data_app_crash, 4f7a766a-d979-436e-99e2-92f925329316
07-10 20:20:01.343 W/ActivityManager(928): Force finishing activity com.txori.omeganaut_debug/org.zgameeditor.ZgeActivity
07-10 20:20:01.586 I/WindowManager(928): Screen frozen for +392ms due to Window{cc8ddd5 u0 Application Error: com.txori.omeganaut_debug}
07-10 20:20:01.951 W/ActivityManager(928): Activity
Re: ZGameEditor & Android Setting
Hi guys,
Apparently you're not allowed to load a shared library with text relocations anymore since SDK 23 .. here's a snippet from the "Android 6.0 Changes" document.
K
Apparently you're not allowed to load a shared library with text relocations anymore since SDK 23 .. here's a snippet from the "Android 6.0 Changes" document.
So it's pretty weird that it doesn't crash on the Samsung Galaxy S6 and ZTE BLADE A520.On previous versions of Android, if your app requested the system to load a shared library with text relocations, the system displayed a warning but still allowed the library to be loaded. Beginning in this release, the system rejects this library if your app's target SDK version is 23 or higher. To help you detect if a library failed to load, your app should log the dlopen(3) failure, and include the problem description text that the dlerror(3) call returns. To learn more about handling text relocations, see this guide.
K
Re: ZGameEditor & Android Setting
Nice finding Kjell. I tried to follow the Hardened/Textrels Guide without sucess. And even if I could make it work, I wouldn't know what to do with the decompiled assembly lines...
So I took a look directly at the file that gives libzgeandroid.so and I think I found a little error:
https://github.com/VilleKrumlinde/zgame ... ndroid.pas
Isn't line 142 missing a ; ??
Other than that, I absolutely don't know what to do. I'm going back at making the game instead of trying to run it on Android. If someone who knows what he is doing wants to continue, maybe that could help: https://bugs.freepascal.org/view.php?id=31764
So I took a look directly at the file that gives libzgeandroid.so and I think I found a little error:
https://github.com/VilleKrumlinde/zgame ... ndroid.pas
Isn't line 142 missing a ; ??
Other than that, I absolutely don't know what to do. I'm going back at making the game instead of trying to run it on Android. If someone who knows what he is doing wants to continue, maybe that could help: https://bugs.freepascal.org/view.php?id=31764
Re: ZGameEditor & Android Setting
Hi Ats,
K
Nope .. in Pascal / Delphi any statement preceding the end keyword isn't required to be closed with a semicolon.Ats wrote:Isn't line 142 missing a ; ??
K