Android porting thread.

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

You need to configure with

Code: Select all

--enable-opengl-shaders
to get the actual GLES2 renderer.
It is not the default currently, but perhaps it should be for Android.
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

Thanks!

It passed the compilation phasebut I got a tons of these:

Code: Select all

/temp/residual_svn/build_android/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: BFD (GNU Binutils) 2.21 assertion fail /usr/local/google/home/andrewhsieh/ndk-andrewhsieh/src/build/../binutils/binutils-2.21/bfd/elf32-arm.c:10180
And ends with:

Code: Select all

make.exe[1]: Entering directory `/tmp/residual_svn/build_android/build.tmp'
make.exe[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make
rule.
Prebuilt       : libresidualvm.so <= jni/../
Install        : libresidualvm.so => libs/armeabi/libresidualvm.so
make.exe[1]: Leaving directory `/tmp/residual_svn/build_android/build.tmp'
/Android/AndroidSDK/tools/android update project -p ./build.tmp -t android-15 -n
 ResidualVM
make: /Android/AndroidSDK/tools/android: Command not found
make: *** [residualvm.apk] Error 127
Which version of SDK and NDK I need?

Thank you
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

Are you sure that /Android/AndroidSDK path exists?
Perhaps you should join our IRC channel so we can fix it a bit faster.
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

Hi,

I know the issue!

In MSYS you can't execute .bat files, you need to call directly the executable file. Also as it is unix/windows environment I have to adjust some issues related to

For example, in the older build system I modified the android.mk file:

Code: Select all

@@ -42,8 +42,8 @@
 
 AAPT = $(ANDROID_SDK)/platform-tools/aapt
 ADB = $(ANDROID_SDK)/platform-tools/adb
-DX = $(ANDROID_SDK)/platform-tools/dx
-APKBUILDER = $(ANDROID_SDK)/tools/apkbuilder
+DX = java -Xmx1024M -Xss1m -Djava.ext.dirs=$(ANDROID_SDK)/platform-tools/lib/ -jar $(ANDROID_SDK)/platform-tools/lib/dx.jar
+APKBUILDER = java -classpath $(ANDROID_SDK)/tools/lib/sdklib.jar com.android.sdklib.build.ApkBuilderMain
 JAVAC ?= javac
 JAVACFLAGS = -source 1.5 -target 1.5
 
@@ -98,15 +98,15 @@
 
 $(PATH_CLASSES_MAIN)/%.class: $(PATH_GEN)/%.java $(SRC_GEN)
 	@$(MKDIR) -p $(@D)
-	$(JAVAC) $(JAVACFLAGS) -cp $(PATH_SRC_TOP) -d $(PATH_BUILD_CLASSES_MAIN_TOP) -bootclasspath $(ANDROID_JAR) $<
+	$(JAVAC) $(JAVACFLAGS) -cp "$(PATH_SRC_TOP);$(PATH_BUILD_CLASSES_MAIN_TOP)" -d $(PATH_BUILD_CLASSES_MAIN_TOP) -bootclasspath $(ANDROID_JAR) -sourcepath "$(PATH_SRC_TOP);$(PATH_GEN_TOP)" $<
 
 $(PATH_CLASSES_MAIN)/%.class: $(PATH_SRC)/%.java $(SRC_GEN)
 	@$(MKDIR) -p $(@D)
-	$(JAVAC) $(JAVACFLAGS) -cp $(PATH_SRC_TOP):$(PATH_GEN_TOP) -d $(PATH_BUILD_CLASSES_MAIN_TOP) -bootclasspath $(ANDROID_JAR) $<
+	$(JAVAC) $(JAVACFLAGS) -cp "$(PATH_SRC_TOP);$(PATH_GEN_TOP);$(PATH_BUILD_CLASSES_MAIN_TOP)" -d $(PATH_BUILD_CLASSES_MAIN_TOP) -bootclasspath $(ANDROID_JAR) -sourcepath "$(PATH_SRC_TOP);$(PATH_GEN_TOP)" $<
 
 $(PATH_CLASSES_PLUGIN)/%.class: $(PATH_SRC)/%.java
 	@$(MKDIR) -p $(@D)
-	$(JAVAC) $(JAVACFLAGS) -cp $(PATH_SRC_TOP) -d $(PATH_BUILD_CLASSES_PLUGIN_TOP) -bootclasspath $(ANDROID_JAR) $<
+	$(JAVAC) $(JAVACFLAGS) -cp "$(PATH_SRC_TOP);$(PATH_BUILD_CLASSES_MAIN_TOP)" -d $(PATH_BUILD_CLASSES_PLUGIN_TOP) -bootclasspath $(ANDROID_JAR) -sourcepath "$(PATH_SRC_TOP);$(PATH_GEN_TOP)" $<
 
 $(FILE_DEX): $(CLASSES_MAIN) $(CLASSES_GEN)
 	$(DX) --dex --output=$@ $(PATH_BUILD_CLASSES_MAIN_TOP)
@@ -136,7 +136,7 @@
 		cd $$work_dir; \
 		$(RM) -rf $(PATH_BUILD_ASSETS)/tmp; \
 		$(MKDIR) $(PATH_BUILD_ASSETS)/tmp; \
-		unzip -q $$i -d $(PATH_BUILD_ASSETS)/tmp; \
+		unzip -o -q $$i -d $(PATH_BUILD_ASSETS)/tmp; \
 		cd $(PATH_BUILD_ASSETS)/tmp; \
 		zip -r ../`basename $$i` *; \
 	done
I didn't notice the changes in the android.mk...


I will fight with the new build system

Thanks
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

The new build system just uses ant, so hopefully it should be less painful :)
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

Ok, I got it!

I have to change the call to the sdk, from the bat to the real java
Update the ndk's toolchain for binutils 2.22 (ld bug regarding the assert)
Add ant to the path

Cheers
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

FYI...

I have compiled jpeg for android as I was missing the Myst3 engine, to give a try... :lol:

Myst3 is not compilable with opengl-shaders engine, so it should be disabled in that case
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

That will change real soon now.
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

wow!!!

:shock: :shock: :shock: :shock:


:shock: :shock: :shock: :shock:
pokito
Posts: 6
Joined: Thu Sep 01, 2011 1:45 pm

Post by pokito »

mac_es > If you are really struggling with MSYS, why don't you try it in linux ?

I personnally use a Debian VM (with virtualbox) and it took me 2h to make my first android compilation (I had to download the android SDK and NDK, that's what took a long time).

Also I'm trying to figure out how git and GitHub work and I will try to make my first pull requests :

- I've added some buttons on the screen fir the main controls (you can show/hide them ingame)
- I've made a quick change to let Manny run when the swipe is big enough (I've still to check if my threshold is really adapted for all the screen size of differents devices)

My next move will be to add an ingame help screen.
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

pokito: if you're stuck with git or github, just ask here or on IRC. Any help is welcome!
pokito
Posts: 6
Joined: Thu Sep 01, 2011 1:45 pm

Post by pokito »

Thanks ^^

I still have to learn how exactly I should use it ^^ Now I see what are the basic commands but I still have to see how to work with them (when to commit, when to pull, when to push).
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

pokito wrote:mac_es > If you are really struggling with MSYS, why don't you try it in linux ?

I personnally use a Debian VM (with virtualbox) and it took me 2h to make my first android compilation (I had to download the android SDK and NDK, that's what took a long time).
Hi,

I use every day ubuntu and centos, also other unixes (solaris and aix) so I don't have any trouble compiling/using these environments...

But the machine which I use for this 'things' is a windows, a quite old windows... so I don't want to get a vm into this hardware.

I have a windows that via msys+mingw can compile:
Scummvm for windows, ps2*, wince*, android
ScummvmTools for windows
ScummvmDevTools for windows
ResidualVM for windows, android
ResidualVMTools for windows
Reminiscence for Windows
Scummex for Windows

* I didn't compile these recently, so I don't know if the actual port is compilable...

Also I have compiled every optional library for windows and added my own patches for scummvm which includes detection for fan translations and copy protection removal (don't ask for it) as I don't want to check for the codes when I'm playing in my phone...

So, as you can see I'm in a quite confortable scenario...

But thanks for the suggestion!
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

@Botje

FYI,

The last commit to the Android build system broke the package creation

I updated my SDK so I can use the aapt task correctly, and It failed with AndroidManifest.xml is not a directory message

The culprit is the nocompress portion of the custom_rules.xml as you have hinted the issue 23894 http://code.google.com/p/android/issues/detail?id=23894

and as mentioned in the issue the workaround works perfectly...

Code: Select all

Index: dists/android/custom_rules.xml
===================================================================
--- dists/android/custom_rules.xml
+++ dists/android/custom_rules.xml
@@ -24,7 +24,7 @@
                     ignoreAssets="${aapt.ignore.assets}">
                 <res path="${out.res.absolute.dir}" />
                 <res path="${resource.absolute.dir}" />
-                <nocompress /> <!-- forces no compression on any files in assets or res/raw -->
+                <nocompress extension='""'/> <!-- forces no compression on any files in assets or res/raw -->
             </aapt>
         </do-only-if-not-library>
     </target>
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

That somehow enables compression for everything, which is what we didn't want.
Passing in just 'zip' as an extension does the trick, I think.
Post Reply