Author Topic: Android Build Issues  (Read 309 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Android Build Issues
« on: 2021-Sep-15 »
Hi

Just tried a new build for android for an older app that built before on the older setups...

Got this error among others for the gzwrite commands?

C:\Users\Lenovo\Documents\GL_PROJECTS\GLBasic\Space2D\distribute\android_studio\app\jni\zlib\gzwrite.c:89:20: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]

Any idea if an update caused this?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline SnooPI

  • Dr. Type
  • ****
  • Posts: 405
    • View Profile
Re: Android Build Issues
« Reply #1 on: 2021-Sep-15 »
Probably a problem with #include <unistd.h>

Add it with the INLINE function at the start of your code.

But there will surely be another problem because the ZLIB has an API C.
« Last Edit: 2021-Sep-16 by SnooPI »

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 343
  • to program what I have todo how should I program?
    • View Profile
Re: Android Build Issues
« Reply #2 on: 2021-Sep-16 »
I can not help you. Since compiling with android studio i have never been able to build. By the way, if anyone of good will wanted to write a mini tutrial, he would be welcome.  :giveup:

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #3 on: 2021-Sep-16 »
So previously I was able to build fine etc.
But some new update must have changes items in the jni/src and jni/zlib
and probably others...

Also, the app gradle file was missing a top reference...

def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');

SF,Gernot was there an update to the android build or c++ sources recently (few months or so)
its been a awhile since i built a new project.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #4 on: 2021-Sep-16 »
I can not help you. Since compiling with android studio i have never been able to build. By the way, if anyone of good will wanted to write a mini tutrial, he would be welcome.  :giveup:

I did a few posts and SF did some others ...
Heres mine
https://www.glbasic.com/forum/index.php?topic=11356.0
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 343
  • to program what I have todo how should I program?
    • View Profile
Re: Android Build Issues
« Reply #5 on: 2021-Sep-16 »
MrPlow  thank you, i will try.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #6 on: 2021-Sep-20 »
I managed a build but android assets sprites, sounds and fonts not working ....
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #7 on: 2021-Sep-21 »
Fonts working now - only sound is not loading...
[update ; fyi - I needed to replace the newer jni source files and glbasic files with ones from when my android compile was working - as the gzwrite and other bugs were failing to build on a new project.]
« Last Edit: 2021-Sep-21 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #8 on: 2021-Sep-21 »
Hi

For those interested the compile issues are now resolved - managed to fix by using compile sdk 30, with targetsdk at 30 minsdk at 23

Last issue was sound and that is resolved now... =D
 

However the templates for android that come with the newest version will need fixing to work for others - I have older libraries was able to restore them for the new project which fixed my issues
« Last Edit: 2021-Sep-21 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3951
    • View Profile
    • Space Fractal
Re: Android Build Issues
« Reply #9 on: 2021-Sep-24 »
its might have mixed in old and new version? im havent checked in a while. target sdk 30 is android 11.

IM did inddeed have most focus on the Spectrum Next game currectly.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #10 on: 2021-Oct-06 »
Thanks SF,
In terms of the src file changes that affect the Android builds - are the android templates src files version controlled so that older files or rollbacks can be obtained if required?

Can advance notice be made on the updates so I dont suddenly build any broken versions :)

I do normally test the apps - but things like controller setups etc. wouldnt be tested each time.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1770
    • View Profile
Re: Android Build Issues
« Reply #11 on: Yesterday at 03:38 PM »
SF,

I know your busy but some file issues on android builds i need to fix...

Can you advise where to put Android.xcl file to prevent overrites?

Also is just deleting jni folder required before a rebuild with newer files?
Or do i need to remove another folder too?

Thks
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs