VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just migrated my emulator(UniPCemu)'s project to also include buildfiles for Android Studio(managed to screw up the old classic installation I've had before, which is deprecated by Google, apparently). It used to be a simple combination of Android SDK, Android NDK (r12b), Apache Ant and Sun Java's JDK. Since I couldn't find the Android SDK anymore(all others could be found easily), I needed to upgrade the project to the Android Studio project, which after some configuration(with options that almost seem unreachable somethimes, finding the build version to set to 1.8 instead of invalid/blank(which I can't find most of the time)) actually starts to compile(after having modified the paths somewhat). Eventually, it reaches the common emulator framework's number_optimizations.c, but then it craps out about not being able to find a .o.d file in the build directory?

Build SDL2_net x86
make: `Z:/MinGW64/msys/home/Tim/unipcemu/android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/libSDL2_net.so' is up to date.
Build main x86
[x86] Compile : main <= number_optimizations.c
error
: error opening 'Z:/MinGW64/msys/home/Tim/unipcemu/android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/main/Z_/MinGW64/msys/home/Tim/unipcemu/android-project/jni/src/__/__/__/UniPCemu/__/commonemuframework/emu/core/number_optimizations.o.d': No such file or directory
1
error generated.
make: *** [Z:/MinGW64/msys/home/Tim/unipcemu/android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/main/Z_/MinGW64/msys/home/Tim/unipcemu/android-project/jni/src/__/__/__/UniPCemu/__/commonemuframework/emu/core/number_optimizations.o] Error 1
:app:externalNativeBuildDebug FAILED

Those __ parts are simply results of parent directory paths being used. All other files (including files with _ in their filenames) compile without a problem. It seems to be 250 characters long(the full path to the file). Maybe it's got something to do with Windows filename limitations?

Edit: After replacing the LOCAL_SRC_PATH 's paths to be relative to the LOCAL_PATH directory, it now continues on compiling, only to error out on linkage to EVERY SINGLE INLINED function? Changing every "inline" keyword to ""(essentially remove it), will make the code much slower, but not doing so causes a lot of undefined reference messages on the inlined functions?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

After having uploaded the new SDL2 (SDL2_net still missing) imported project from Android Studio (checking text files for relative paths) and repulling the entire repository, it now seems to be missing something? It keeps complaining about missing the SDL2 module? Importing the SDL2 module from C:\Androidlibs\SDL2-2.0.7\android-project seems to not resolve the compiler error? Anyone got a guide to importing the old SDL2(_net) project into Android-studio using the old makefiles unmodified with full backwards compatibility of the old ndk-build compilation method?

I've followed this guide to creating a basic SDL2 project, then adding the custom android-studio.mk file(which redirects to the actual makefile, providing a simple wrapper for Android Studio to the old android-project/src/Android.mk for easy compatibility (adding a ANDROIDSTUDIO=1 define for easy detection of Android Studio building). Atm all the define does is disable the OPTINLINE keyword being used (which inlines some used functions, which cause compiler problems with the current Android NDK, worked on r12b, but unable to install that one: ( It disables those by adding a __DISABLE_INLINE define to do this).

Oddly enough, something seems to be missing after pushing to the repository and freshly pulling it (discarding any local ignored files)? That causes loading and compiling to fail on the missing SDL2 module?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

These are my current .gitignores:
Source code symbolic links: https://bitbucket.org/superfury/unipcemu/src/ … gnore?at=master
Main .gitignore in the repository: https://bitbucket.org/superfury/unipcemu/src/ … gnore?at=master

Anyone noticing problems in those?

I've found this .gitignore:
https://github.com/github/gitignore/blob/mast … rains.gitignore

Is that one any good?

My main .gitignore mentioned above removes symbolic links from source control(needs to be created manually using the admin command prompt calling the batch file on windows).

Further, the main repository .gitignore implements the following .gitignores:
https://www.gitignore.io/api/visualstudio
https://www.gitignore.io/api/android
https://www.gitignore.io/api/c++

Adding to those templates, I've added(repository itself, SDL2 symlinks and Visual Studio temp files):

android-project/jni/SDL2/
android-project/jni/SDL2_net/
android-project/src/org/libsdl/app/
UniPCemu/enc_temp_folder

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

After some more tries and reevaluating the .gitignore files, it now seems to work properly, in a compatible way with the older Android NDK. It just requires some batch file which needs to be called from an elevated command prompt(on Windows 10) to create some symbolic directory/file links to the src/jni/res directories and AndroidManifest.xml file for it to work(on top of the other usual steps required for using SDL2 and/or SDL2_net).

I just tried running the SDL2_net app on the Android Studio emulator, but I keep getting a black screen instead of the app running? Is it simply slow(I'm on a i7-4790K@4GHz), or may it be due to inline fumctions being non-inlined now(due to NDK linking issues)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

After some more configuration, it now behaves properly, running on both emulator and actual device:D

Also downgraded the NDK to r12b for proper inline support. It compiles properly on r12b, not sure about newer versions(current is r16b)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io