• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Android v
« Previous 1 ... 53 54 55 56 57 ... 127 Next »

Generic build from the code on Github
View New Posts | View Today's Posts

Pages (2): 1 2 Next »
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Generic build from the code on Github
11-04-2018, 03:17 AM
#1
Pimenov Offline
Member
***
Posts: 162
Threads: 100
Joined: Nov 2018
Hi everybody,

I wanted to compile an unofficial generic build for Android (that means it could support not only x86-64 and ARMv8 but ARMv7 and x86 also).

But when I enabled "Generic Build" (put 'on' in the option in CMakeLists.txt) and when I compile it, it gives me some syntax errors that I can't fix because I'm not a programmer.

If I update Gradle, SDK and the API level, it compiles, but doesn't get built due to a missing thing, in NDK's part called LLVM, called 'lbdisasm'.

Can somebody help me to do such a compilation?
Find
Reply
11-04-2018, 03:23 AM
#2
Ethanwinters88 Offline
Banned
Posts: 97
Threads: 13
Joined: Aug 2018
Wish i could help u but im not that expert in coding..ill be more then happy to test ur apk once u manage to complete it...thabks in thebmeantime for ur dedication in mali drivers
Website Find
Reply
11-04-2018, 03:26 AM
#3
Helios Offline
Stellaaaaaaa
**********
Developers (Some Administrators and Super Moderators)
Posts: 4,397
Threads: 15
Joined: May 2012
You are aware you won't get a JIT with a generic build right?

You'll be measuring in single digit FPS
Find
Reply
11-04-2018, 03:36 AM
#4
Pimenov Offline
Member
***
Posts: 162
Threads: 100
Joined: Nov 2018
(11-04-2018, 03:26 AM)Helios Wrote: You are aware you won't get a JIT with a generic build right?

You'll be measuring in single digit FPS

Yes, I'm aware.

And, please, compile me the generic .apk build if you are a coder.
Find
Reply
11-04-2018, 11:45 AM
#5
mbc07 Offline
Wiki Caretaker
*******
Content Creators (Moderators)
Posts: 3,566
Threads: 47
Joined: Dec 2010
Clone Dolphin's repository, install Android Studio and the needed dependencies, then open Source\Android\app\build.gradle within Android Studio or with your preferred text editor. There's two things you'll need to change in order to successfully compile a generic Android build:

On the first defaultConfig section, you'll find this:
Code:
   defaultConfig {
       // TODO If this is ever modified, change application_id in strings.xml
       applicationId "org.dolphinemu.dolphinemu"
       minSdkVersion 21
       targetSdkVersion 27

       versionCode(getBuildVersionCode())

       versionName "${getVersion()}"
   }

Here, you need to change minSdkVersion to 24 or higher (yes, that means the compiled APK will install only on Nougat and newer). That's the only way I found to avoid some NDK compilation errors when building a generic version, but you can try to workaround the compilation issues by yourself if you choose to leave minSdkVersion on 21 (that's Lollipop and newer).

Then, keep scrolling until you find the second defaultConfig section:
Code:
   defaultConfig {
       externalNativeBuild {
           cmake {
               arguments "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=RelWithDebInfo"  // , "-DENABLE_GENERIC=ON"
               abiFilters "arm64-v8a", "x86_64" //, "armeabi-v7a", "x86"
           }
       }
   }

Do you see that "armeabi-v7a" and "x86" are commented out? So, uncomment them, alongside with "-DENABLE_GENERIC=ON" on the line right above it in order to get a generic build (like Helios already said, that means no JIT and you'll be lucky to get more than a single-digit FPS if you decide to actually run something with it).

After making the changes, just compile the Android version through Android Studio like you normally would and you should get a generic APK, without JIT, which should install and run fine on ARMv7/x86 devices...
Avell A70 MOB: Core i7-11800H, GeForce RTX 3060, 16 GB DDR4-3200, Windows 11 (Insider Preview)
ASRock Z97M OC Formula: Pentium G3258, GeForce GT 440, 16 GB DDR3-1600, Windows 10 (22H2)
Find
Reply
11-04-2018, 02:54 PM
#6
Guilherme Offline
Just another geek
***
Posts: 220
Threads: 9
Joined: Oct 2013
I tried here, did all that but got an error like this: https://github.com/bazelbuild/intellij/issues/118

I'm downloading the 2.3.3 version of Android Studio and I'll see what happens.
PC: AMD Ryzen 5 3600 / GTX 660 2GB / 16GB DDR4 3600MHz / Windows 10 Pro

Phones: Poco F3 8/256GB (Snapdragon 870 5G) and Redmi Note 6 Pro 4/64GB (Snapdragon 636)
Find
Reply
11-04-2018, 08:18 PM
#7
Pimenov Offline
Member
***
Posts: 162
Threads: 100
Joined: Nov 2018
(11-04-2018, 11:45 AM)mbc07 Wrote: Clone Dolphin's repository, install Android Studio and the needed dependencies, then open Source\Android\app\build.gradle within Android Studio or with your preferred text editor. There's two things you'll need to change in order to successfully compile a generic Android build:

On the first defaultConfig section, you'll find this:

Code:
   defaultConfig {
       // TODO If this is ever modified, change application_id in strings.xml
       applicationId "org.dolphinemu.dolphinemu"
       minSdkVersion 21
       targetSdkVersion 27

       versionCode(getBuildVersionCode())

       versionName "${getVersion()}"
   }

Here, you need to change minSdkVersion to 24 or higher (yes, that means the compiled APK will install only on Nougat and newer). That's the only way I found to avoid some NDK compilation errors when building a generic version, but you can try to workaround the compilation issues by yourself if you choose to leave minSdkVersion on 21 (that's Lollipop and newer).

Then, keep scrolling until you find the second defaultConfig section:

Code:
   defaultConfig {
       externalNativeBuild {
           cmake {
               arguments "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=RelWithDebInfo"  // , "-DENABLE_GENERIC=ON"
               abiFilters "arm64-v8a", "x86_64" //, "armeabi-v7a", "x86"
           }
       }
   }

Do you see that "armeabi-v7a" and "x86" are commented out? So, uncomment them, alongside with "-DENABLE_GENERIC=ON" on the line right above it in order to get a generic build (like Helios already said, that means no JIT and you'll be lucky to get more than a single-digit FPS if you decide to actually run something with it).

After making the changes, just compile the Android version through Android Studio like you normally would and you should get a generic APK, without JIT, which should install and run fine on ARMv7/x86 devices...

What version of the SDK, gradle and NDK, and what API level you use?
I used the latest sdk, gradle, ndk and API, but i do what you wrote, but it gives me an error such as 'not found -lbdisasm'

When I do it without updating, it gives me syntax errors such as 'unknown command'
Find
Reply
11-05-2018, 02:54 AM
#8
mbc07 Offline
Wiki Caretaker
*******
Content Creators (Moderators)
Posts: 3,566
Threads: 47
Joined: Dec 2010
Last time I tried I was running the latest stable version of Android Studio and let it download the required dependencies it complained about when opening Dolphin app. Then I made the changes I mentioned in the previous post and it compiled successfully...
Avell A70 MOB: Core i7-11800H, GeForce RTX 3060, 16 GB DDR4-3200, Windows 11 (Insider Preview)
ASRock Z97M OC Formula: Pentium G3258, GeForce GT 440, 16 GB DDR3-1600, Windows 10 (22H2)
Find
Reply
11-05-2018, 08:35 AM
#9
Pimenov Offline
Member
***
Posts: 162
Threads: 100
Joined: Nov 2018
(11-05-2018, 02:54 AM)mbc07 Wrote: Last time I tried I was running the latest stable version of Android Studio and let it download the required dependencies it complained about when opening Dolphin app. Then I made the changes I mentioned in the previous post and it compiled successfully...
I used Android Studio 3.2.1 with CMake, LLDB and NDK and it gave me this error when I try to compile a generic android build:


Code:
FAILED: C:\Users\user\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe  --target=aarch64-none-linux-android24 --gcc-toolchain=C:/Users/user/AppData/Local/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=C:/Users/user/AppData/Local/Android/Sdk/ndk-bundle/sysroot  -DANDROID -DCURL_STATICLIB -DDATA_DIR="\"C:/Program Files (x86)/dolphin-emu/share/dolphin-emu/\"" -DHAVE_EGL=1 -DSFML_STATIC -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_GENERIC=1 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I../../../../../../../Externals/curl/include -I../../../../../../../Externals/SFML/include -I../../../../../../Core -I../../../../../ -I../../../../../../../Externals/enet/include -I../../../../../../../Externals -I../../../../../../../Externals/mbedtls/include -I../../../../../../../Externals/libiconv-1.14/include -ISource/Core -isystem ../../../../../../Core/Common/Compat -I../../../../../../../Externals/libpng -isystem C:/Users/user/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include -isystem C:/Users/user/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -isystem C:/Users/user/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/aarch64-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11  -O2 -g -DNDEBUG -fPIC   -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wshadow -Winit-self -Wmissing-declarations -Wmissing-variable-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -std=c++17 -MD -MT Source/Core/Common/CMakeFiles/common.dir/CommonFuncs.cpp.o -MF Source\Core\Common\CMakeFiles\common.dir\CommonFuncs.cpp.o.d -o Source/Core/Common/CMakeFiles/common.dir/CommonFuncs.cpp.o -c C:\Users\user\Downloads\dolphin-master\dolphin-master\Source\Core\Common\CommonFuncs.cpp
C:\Users\user\Downloads\dolphin-master\dolphin-master\Source\Core\Common\CommonFuncs.cpp:36:7: error: cannot initialize a variable of type 'int' with an rvalue of type 'char *'
 int error_code = strerror_r(errno, error_message, BUFFER_SIZE);

My minimum API level is 24 and my target API level is 27. The required build tools are installed.

What's wrong and how can I fix the error and compile the generic build?
Find
Reply
11-05-2018, 09:09 AM
#10
mbc07 Offline
Wiki Caretaker
*******
Content Creators (Moderators)
Posts: 3,566
Threads: 47
Joined: Dec 2010
Try bumping minSdkVersion to 26 (although I'm pretty sure 24 was enough). If that doesn't work too, then I have no clue. And just to be sure, are you using the latest version of the NDK? That's crucial too...
Avell A70 MOB: Core i7-11800H, GeForce RTX 3060, 16 GB DDR4-3200, Windows 11 (Insider Preview)
ASRock Z97M OC Formula: Pentium G3258, GeForce GT 440, 16 GB DDR3-1600, Windows 10 (22H2)
Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode