I use gradle with gradle experimantal plugin "com.android.tools.build:gradle-experimental:0.8.0-rc2"
I use SDL 2.0.4 for android apk building. Apk installs and runs successfully.
I try migrate to SDL 2.0.7 I use new java classess from android-project\src\org\libsdl\app
SDL.java
SDLActivity.java
SDLAudioManager.java
SDLControllerManager.java
and get error
10-28 20:52:45.414 2759 2780 E AndroidRuntime: FATAL EXCEPTION: SDLThread
10-28 20:52:45.414 2759 2780 E AndroidRuntime: Process: org.libsdl.app, PID: 2759
10-28 20:52:45.414 2759 2780 E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object) (tried Java_org_libsdl_app_SDLActivity_nativeInit and Java_org_libsdl_app_SDLActivity_nativeInit__Ljava_lang_Object_2)
10-28 20:52:45.414 2759 2780 E AndroidRuntime: at org.libsdl.app.SDLActivity.nativeInit(Native Method)
10-28 20:52:45.414 2759 2780 E AndroidRuntime: at org.libsdl.app.SDLMain.run(SDLActivity.java:971)
10-28 20:52:45.414 2759 2780 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)
10-28 20:52:45.589 1564 1939 W ActivityManager: Force finishing activity org.libsdl.app/.MainActivity
As far I see file src\main\android\SDL_android_main.c is empty now.
My gradle file is
apply plugin: ‘com.android.model.native’
model {
android {
compileSdkVersion = 24
buildToolsVersion = ‘23.0.3’
defaultConfig {
minSdkVersion.apiLevel = 13
targetSdkVersion.apiLevel = 16
versionCode = 1
versionName = '1.0'
}
ndk {
moduleName = 'SDL2'
//platformVersion = "9"
ldLibs.addAll(["GLESv1_CM", "EGL", "GLESv2", "log", "android", "dl"])
CFlags.addAll(["-DGL_GLEXT_PROTOTYPES"])
CFlags.addAll(["-I" + file("../../SDL/include/").absolutePath,"-DGL_GLEXT_PROTOTYPES"])
CFlags.addAll(["-I" + file("../../SDL/src/core/android/").absolutePath,"-DGL_GLEXT_PROTOTYPES"])
}
sources {
main {
jni {
source {
srcDir "../../SDL/src"
exclude "audio/alsa/"
exclude "audio/arts/"
exclude "audio/bsd/"
exclude "audio/coreaudio/"
exclude "audio/directsound/"
exclude "audio/disk/"
exclude "audio/dsp/"
exclude "audio/emscripten/"
exclude "audio/esd/"
exclude "audio/fusionsound/"
exclude "audio/haiku/"
exclude "audio/nacl/"
exclude "audio/nas/"
exclude "audio/psp/"
exclude "audio/pulseaudio/"
exclude "audio/qsa/"
exclude "audio/sndio/"
exclude "audio/sun/"
exclude "audio/winmm/"
exclude "audio/xaudio2/"
exclude "core/linux/"
exclude "core/windows/"
exclude "core/winrt/"
exclude "file/cocoa/"
exclude "haptic/windows/"
exclude "haptic/darwin/"
exclude "haptic/linux/"
exclude "libm/"
exclude "main/dummy/"
exclude "main/android/"
exclude "main/haiku/"
exclude "main/nacl/"
exclude "main/psp/"
exclude "main/windows/"
exclude "main/winrt/"
exclude "joystick/bsd/"
exclude "joystick/darwin/"
exclude "joystick/dummy/"
exclude "joystick/emscripten/"
exclude "joystick/haiku/"
exclude "joystick/iphoneos/"
exclude "joystick/linux/"
exclude "joystick/psp/"
exclude "joystick/windows/"
exclude "loadso/dummy/"
exclude "loadso/haiku/"
exclude "loadso/windows/"
exclude "power/emscripten/"
exclude "power/haiku/"
exclude "power/linux/"
exclude "power/macosx/"
exclude "power/psp/"
exclude "power/uikit/"
exclude "power/windows/"
exclude "power/winrt/"
exclude "filesystem/cocoa/"
exclude "filesystem/dummy/"
exclude "filesystem/emscripten/"
exclude "filesystem/haiku/"
exclude "filesystem/nacl/"
exclude "filesystem/unix/"
exclude "filesystem/windows/"
exclude "filesystem/winrt/"
exclude "render/direct3d/"
exclude "render/direct3d11/"
exclude "thread/generic/"
exclude "thread/psp/"
exclude "thread/stdcpp/"
exclude "thread/windows/"
exclude "timer/dummy/"
exclude "timer/haiku/"
exclude "timer/psp/"
exclude "timer/windows/"
exclude "video/cocoa/"
exclude "video/directfb/"
exclude "video/dummy/"
exclude "video/emscripten/"
exclude "video/haiku/"
exclude "video/mir/"
exclude "video/nacl/"
exclude "video/pandora/"
exclude "video/psp/"
exclude "video/raspberry/"
exclude "video/uikit/"
exclude "video/vivante/"
exclude "video/wayland/"
exclude "video/windows/"
exclude "video/winrt/"
exclude "video/x11/"
exclude "video/qnx/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "haptic/windows/"
exclude "test/"
}
}
}
}
}
}
// This is just copy out the header file and built lib into distribution
// directory for clint application to use; it is a small overhead of this sample:
// both lib and app are put inside one project space [save maintenance time]
task(distributeLib, type : Copy) {
// trigger build library
dependsOn assemble
into '…/lib/'
from(‘build/outputs/native/release/lib/’) {
into ‘…/lib/’
}
}
What I’m doing wrong?