Compile Android Build

Its strange im sure i responded here on the next day that the apk works on my LG G3. :o
Im getting all the files and to compile android build, i have a lor of spritework but i have to do this finally.
--
Ok im onto it, i compiled windows build, now im installing android SDK with sdk bat file in android folder.
---
Adding  paths and all that isnt well documented for newcomers, quite vague and scary.

This should help :
http://www.software-testing-tutorials-automation.com/2015/09/set-androidhome-and-path-environment.html
This could go to first post along with the link
set%2BANDROID_HOME%2Benvironment%2Bvariable.png

----
I had troubles with spaces in my username in users folder, it was "lenovo x230T" with space, and  ndk-build gave me error because of this, so i had to go through changing my user folder and all paths in system with regedit and tools.Not recommended but had to be done.
Now my java -version is recognizable but ndk-build says i dont have android project setup.
7f6dbf44.jpg

I find it fascinating how every step along the way have some issues and i have to overcome them myself by modifications and googling around, i hope others wont have them.I
would prefere if it all just worked right away.
---

Another issue, creating keystore doesnt work, it just opens and closes bat file immediately.When i drag it to command window then it says keytool command is not recognized.
Ill leave making keystore, moving on to test build.bat
 
This is what i get when running build.bat from android folder , id like to at least build non customizable apk file.Im on Win 7.
de239fb8.jpg

--
Read about that online then added this to gradle.properties file
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx1024m
There was just first line, i added second one and something moved... compiling/configuring/downloading
0e03da03.jpg

--
got error cuse keystore.properties wasnt in folder, tried again.
hahaha  ;D another error, this one is hilarious, it appears that there is no tools.jar in java folders anywhere, a bit of reading online... they removed tools.jar since version 9 and i have 12, will downgrade to 8 and let you know how it goes... wow, cant believe all the damn quirks.Compiling windows is like a walk in the park, this is just like walking on landmines  ;D
---
This is where im right now, another error
Code:
C:\openbor.git\branches\Malik-Updates\engine\android>cmd /k "gradlew.bat clean &
 gradlew.bat assembleDebug"
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reus
ed, use --status for details

> Task :app:externalNativeBuildCleanDebug
Clean cpufeatures armeabi-v7a,openbor armeabi-v7a
process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolchain
s/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) failed.

[armeabi-v7a] "Clean          ": "SDL2 [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "cpufeatures [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "ogg [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "openbor [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "png [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "stdc++ [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "vorbisidec [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "vpx [armeabi-v7a]"

> Task :app:externalNativeBuildCleanRelease
Clean cpufeatures armeabi-v7a,openbor armeabi-v7a
process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolchain
s/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) failed.

[armeabi-v7a] "Clean          ": "SDL2 [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "cpufeatures [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "ogg [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "openbor [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "png [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "stdc++ [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "vorbisidec [armeabi-v7a]"
[armeabi-v7a] "Clean          ": "vpx [armeabi-v7a]"

BUILD SUCCESSFUL in 2m 27s
4 actionable tasks: 3 executed, 1 up-to-date

> Task :app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\openbor.git\branches\Malik-Updates\engine\android\app\src\main\java\org
\libsdl\app\SDLActivity.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :app:externalNativeBuildDebug FAILED
Build openbor armeabi-v7a
process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolchain
s/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) failed.

[armeabi-v7a] "Compile thumb  ": "openbor <= control.c"
process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolchain
s/llvm/prebuilt/windows-x86_64/bin/clang.exe -MMD -MP -MF C:/openbor.git/branche
s/Malik-Updates/engine/android/app/build/intermediates/ndkBuild/debug/obj/local/
armeabi-v7a/objs-debug/openbor/__/__/__/__/sdl/control.o.d -target armv7-none-li
nux-androideabi19 -fdata-sections -ffunction-sections -fstack-protector-strong -
funwind-tables -no-canonical-prefixes --sysroot C:/android/SDK/ndk-bundle/build/
/../toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -Wno-invalid-command-line
-argument -Wno-unused-command-line-argument -fno-addrsig -fpic -march=armv7-a -m
thumb -O0 -UNDEBUG -fno-limit-debug-info -IC:/openbor.git/branches/Malik-Updates
/engine/android/app/jni/openbor/src/ -IC:/openbor.git/branches/Malik-Updates/eng
ine/android/app/jni/openbor/include/ -IC:/openbor.git/branches/Malik-Updates/eng
ine/android/app/jni/openbor/include/png -IC:/openbor.git/branches/Malik-Updates/
engine/android/app/jni/openbor/include/sdl -IC:/openbor.git/branches/Malik-Updat
es/engine/android/app/jni/openbor/../../../.. -IC:/openbor.git/branches/Malik-Up
dates/engine/android/app/jni/openbor/../../../../sdl -IC:/openbor.git/branches/M
alik-Updates/engine/android/app/jni/openbor/../../../../resources -IC:/openbor.g
it/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source -IC:
/openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../s
ource/adpcmlib -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/op
enbor/../../../../source/gamelib -IC:/openbor.git/branches/Malik-Updates/engine/
android/app/jni/openbor/../../../../source/gfxlib -IC:/openbor.git/branches/Mali
k-Updates/engine/android/app/jni/openbor/../../../../source/pnglib -IC:/openbor.
git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source/pre
processorlib -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/open
bor/../../../../source/ramlib -IC:/openbor.git/branches/Malik-Updates/engine/and
roid/app/jni/openbor/../../../../source/randlib -IC:/openbor.git/branches/Malik-
Updates/engine/android/app/jni/openbor/../../../../source/scriptlib -IC:/openbor
.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source/op
enborscript -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/openb
or/../../../../source/tracelib2 -IC:/openbor.git/branches/Malik-Updates/engine/a
ndroid/app/jni/openbor/../../../../source/webmlib -IC:/openbor.git/branches/Mali
k-Updates/engine/android/app/jni/openbor/../../../../source/webmlib/halloc -IC:/
openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../so
urce/webmlib/nestegg -IC:/android/SDK/ndk-bundle/build//../sources/cxx-stl/syste
m/include -IC:/android/SDK/ndk-bundle/build//../sources/android/cpufeatures -IC:
/openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor -DANDROID -g
-O2 -Wall -Werror -Wno-unused-result -fsigned-char -fno-ident -freorder-blocks -
DLINUX -DSDL=1 -DANDROID=1 -DTREMOR=1 -DWEBM=1 -Wa,--noexecstack -Wformat -Werro
r=format-security -c C:/openbor.git/branches/Malik-Updates/engine/android/app/jn
i/openbor/../../../../sdl/control.c -o C:/openbor.git/branches/Malik-Updates/eng
ine/android/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-de
bug/openbor/__/__/__/__/sdl/control.o, ...) failed.
make (e=2): Nie mo?na odnale?? okre?lonego pliku.
make: *** [C:/openbor.git/branches/Malik-Updates/engine/android/app/build/interm
ediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/openbor/__/__/__/__/sdl/
control.o] Error 2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process C:\android\SDK\ndk-bundle\ndk-build.cmd with arg
uments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\openbor.git\branches\Malik-Upd
ates\engine\android\app\jni\Android.mk NDK_APPLICATION_MK=C:\openbor.git\branche
s\Malik-Updates\engine\android\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_AL
L_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-19 NDK_OUT=C:/openbor.git/br
anches/Malik-Updates/engine/android/app/build/intermediates/ndkBuild/debug/obj N
DK_LIBS_OUT=C:\openbor.git\branches\Malik-Updates\engine\android\app\build\inter
mediates\ndkBuild\debug\lib APP_PLATFORM=android-19 C:/openbor.git/branches/Mali
k-Updates/engine/android/app/build/intermediates/ndkBuild/debug/obj/local/armeab
i-v7a/libopenbor.so}
  process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolcha
ins/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) faile
d.
  [armeabi-v7a] "Compile thumb  ": "openbor <= control.c"
  process_begin: CreateProcess(NULL, C:/android/SDK/ndk-bundle/build//../toolcha
ins/llvm/prebuilt/windows-x86_64/bin/clang.exe -MMD -MP -MF C:/openbor.git/branc
hes/Malik-Updates/engine/android/app/build/intermediates/ndkBuild/debug/obj/loca
l/armeabi-v7a/objs-debug/openbor/__/__/__/__/sdl/control.o.d -target armv7-none-
linux-androideabi19 -fdata-sections -ffunction-sections -fstack-protector-strong
 -funwind-tables -no-canonical-prefixes --sysroot C:/android/SDK/ndk-bundle/buil
d//../toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -Wno-invalid-command-li
ne-argument -Wno-unused-command-line-argument -fno-addrsig -fpic -march=armv7-a
-mthumb -O0 -UNDEBUG -fno-limit-debug-info -IC:/openbor.git/branches/Malik-Updat
es/engine/android/app/jni/openbor/src/ -IC:/openbor.git/branches/Malik-Updates/e
ngine/android/app/jni/openbor/include/ -IC:/openbor.git/branches/Malik-Updates/e
ngine/android/app/jni/openbor/include/png -IC:/openbor.git/branches/Malik-Update
s/engine/android/app/jni/openbor/include/sdl -IC:/openbor.git/branches/Malik-Upd
ates/engine/android/app/jni/openbor/../../../.. -IC:/openbor.git/branches/Malik-
Updates/engine/android/app/jni/openbor/../../../../sdl -IC:/openbor.git/branches
/Malik-Updates/engine/android/app/jni/openbor/../../../../resources -IC:/openbor
.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source -I
C:/openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../..
/source/adpcmlib -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/
openbor/../../../../source/gamelib -IC:/openbor.git/branches/Malik-Updates/engin
e/android/app/jni/openbor/../../../../source/gfxlib -IC:/openbor.git/branches/Ma
lik-Updates/engine/android/app/jni/openbor/../../../../source/pnglib -IC:/openbo
r.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source/p
reprocessorlib -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/op
enbor/../../../../source/ramlib -IC:/openbor.git/branches/Malik-Updates/engine/a
ndroid/app/jni/openbor/../../../../source/randlib -IC:/openbor.git/branches/Mali
k-Updates/engine/android/app/jni/openbor/../../../../source/scriptlib -IC:/openb
or.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../source/
openborscript -IC:/openbor.git/branches/Malik-Updates/engine/android/app/jni/ope
nbor/../../../../source/tracelib2 -IC:/openbor.git/branches/Malik-Updates/engine
/android/app/jni/openbor/../../../../source/webmlib -IC:/openbor.git/branches/Ma
lik-Updates/engine/android/app/jni/openbor/../../../../source/webmlib/halloc -IC
:/openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor/../../../../
source/webmlib/nestegg -IC:/android/SDK/ndk-bundle/build//../sources/cxx-stl/sys
tem/include -IC:/android/SDK/ndk-bundle/build//../sources/android/cpufeatures -I
C:/openbor.git/branches/Malik-Updates/engine/android/app/jni/openbor -DANDROID -
g -O2 -Wall -Werror -Wno-unused-result -fsigned-char -fno-ident -freorder-blocks
 -DLINUX -DSDL=1 -DANDROID=1 -DTREMOR=1 -DWEBM=1 -Wa,--noexecstack -Wformat -Wer
ror=format-security -c C:/openbor.git/branches/Malik-Updates/engine/android/app/
jni/openbor/../../../../sdl/control.c -o C:/openbor.git/branches/Malik-Updates/e
ngine/android/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-
debug/openbor/__/__/__/__/sdl/control.o, ...) failed.
  make (e=2): Nie mo?na odnale?? okre?lonego pliku.
  make: *** [C:/openbor.git/branches/Malik-Updates/engine/android/app/build/inte
rmediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/openbor/__/__/__/__/sd
l/control.o] Error 2


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 54s
17 actionable tasks: 15 executed, 2 up-to-date

C:\openbor.git\branches\Malik-Updates\engine\android>

I can tell nobody else tried to compile android from this tutorial, it points to version 12 which is wrong one and someone would complain about the same error i had with 12.
Could you give info about the same versions you have installed ? and all paths , vars in system .Im ready to try it again but want to do it exactly like you, same versions and step by step including when to restart pc.Im a bit tired of these errors, i knew it was gonna be like that , thats why i postponed it a bit.
Tutorial is very vague, also you skip to custom apk, id prefer to just compile normal apk for starters.Also creating variables is not explained, where and how to do it.So even reading this quickly can scare people off.
 
I DID IT ! Compiled Android build !
Custom one with custom name.
What i did is that i deleted gradle folder in my user folder on C: , then i reinstalled java sdk  version 8.
Then i installed tools (command line version) to c:android/sdk/tools
went to msmalik build, android folder and ran gradlew.bat first so gradle would download, then ran sdk-setup.bat .
Tried to compile with build.bat and it all went through, no errors !
All SKD in android folder on C have about 3GB in size, thats good to know.
I had no ide why it made difference but im glad it works, where should i place my pak file so it would install it with apk ?
 
I uploaded to google play, how long did you wait for them for checking the violence level so you can make it visible on store ?
Ok nevermind i had to press button to calculate it for me, now its waiting for release in store .
 
Woohoo, here it is on play store :
https://play.google.com/store/apps/details?id=org.bearz.game
 
Great job I have downloaded and it works great on my s7.  Well there is a issue when you die the wont end it will wait for you to continue ?? But that is for another topic.

Congratulations and I hope to see many more.
 
I think i know what You mean, i tested it and all works fine, i just gave all characters 99 credits so you wont gameover yourself too much  ;D
 
bWWd said:
I think i know what You mean, i tested it and all works fine, i just gave all characters 99 credits so you wont gameover yourself too much  ;D

Good you went through! Would you mind telling me how large is your .pak file? bWWd
 
apk is about 16 MB because its zip file, and PAK itself is 20MB.
By the way, link to java in first post should be changed, it cant be version 12, has to be version 8 because it wont work with 12.
 
bWWd said:
apk is about 16 MB because its zip file, and PAK itself is 20MB.
By the way, link to java in first post should be changed, it cant be version 12, has to be version 8 because it wont work with 12.

Thanks for info bWWd. I asked this just to validate the method used inside openbor. For your case, it's totally safe, < 100MB.
For really big .pak above 100 MB mark, this will involve technique Google suggests which noted in Development.txt of android directory, yes, until then we will see real use case with openbor, and see if there's any problem or how further this part could be improved.

By all means, cheers for your app on play store man :)
 
Youre right and i will take into consideration filesize during creating process so i wont exceed it.
 
  • Either way , the 1st instruction step that uses sdk-setup.bat only works if the path matches the "new" path on the website link


    msmalik681 said:
    Now you can setup your environment variables use the search bar to search for "advanced system settings" that window will have a button at the bottom for "Enviroment Variables" now select "New" under "user variable":

    • "ANDROID_HOME" = "C:\android\sdk"


    Next hit "New" under "system variable":

    • "JAVA_HOME" = "C:\Program Files\Java\jdk-13"

    Now setup System Variables -> Path add these lines:

    • "C:\Program Files\Java\jdk-13\bin" (note "jdk-13" this folder may be different based on your version installed)
    • "C:\android\sdk\tools\bin"
    • "C:\android\sdk\build-tools\28.0.3"
    • "C:\android\sdk\ndk-bundle"
msmalik681 said:

Also, im not sure on what new line to add or to write  for the system variables
 
Ok , Understood.

So far i have this:

First get the Android SDK. Download from "https://developer.android.com/studio" the command line tools only package for windows and save it to "C:/android/sdk" folder (if you do not have this path make it). Extract the tools folder here. Now you can run the file "sdk-setup.bat

this step made a bunch of downloads & it only worked if sdkmanager.bat is in this path:
C:\android\sdk\$HOME\Development\android\cmdline-tools\Latest\bin

after the downloads, there is a new tools folder.
just as a test
build.bat & gradlew.bat give me a weird error about missing licences.

Code:
'bash.exe' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
ECHO is off.

> Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\android\sd
k\$HOME\Development\android\cmdline-tools\latest\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\android\sdk\$HOME
\Development\android\cmdline-tools\latest\licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not
 been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to anot
her, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\android\sdk\$HOME\Development\android\cmdline-tools\late
st

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

> Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\android\sd
k\$HOME\Development\android\cmdline-tools\latest\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\android\sdk\$HOME
\Development\android\cmdline-tools\latest\licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not
 been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to anot
her, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\android\sdk\$HOME\Development\android\cmdline-tools\late
st

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
<-------------> 0% WAITING
> IDLE

C:\android\sdk>
 
i think it works now - the only step that gets messed up is the first, becuase the downloads don't happen.

i manually copy pasted the folders needed from the downloads that worked using the alternative path

that said - how can i compile the .apk without having a device connected?

Code:
C:\android\sdk>gradlew installDebug

> Task :app:externalNativeBuildDebug
Build openbor armeabi-v7a
make: 'C:/android/sdk/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v
7a/libopenbor.so' is up to date.

> Task :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
31 actionable tasks: 2 executed, 29 up-to-date
 
Back
Top Bottom