I'm trying to get the basic TeamSpeak SDK examples to run in Android. They seem to work fine in the Unity Editor, and as a Windows build. But there are issues with Android that I don't understand. Hopefully somebody can verify things work for them and give me some pointers on what I may be missing.
Here's my basic setup:
Windows 10 Pro
Unity 2018.2.19f1
TeamSpeak SDK 2018 2.11 (SDK 3.0.4.4) Unity Package
I've got the SDK Server running locally, and can connect to it fine in the Editor and from standalone Windows builds. All the example scenes (3D Sound Unity, Lobby_Example, and Minimal_Mobile) seem to work great.
However when I switch platform and build it for Android, something with the native plugin isn't wired up correctly. I leave the defaults in Player Settings -> Target Architectures set to ARMv7 and x86. So there should be 4 libraries included, I think:
Assets/Plugins/android/armeabi-v7a/libopensles_ts_soundbackend.so
Assets/Plugins/android/armeabi-v7a/libts3client.so
Assets/Plugins/android/x86/libopensles_ts_soundbackend.so
Assets/Plugins/android/x86/libts3client.so
But when I build, the resulting .apk file only has one of those libraries in it: lib/x86/libts3client.so
When I run the .apk on an android device, it understandably fails the first time it tries to access the library with this:
Code:
I/Unity (17795): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 1815mb
I/Unity (17795): SystemInfo ARM big.LITTLE configuration: 2 big (mask: 0xc), 2 little (mask: 0x3)
I/Unity (17795): ApplicationInfo com.Test.TeamSpeak version 0.1 build f7fb1229-eed8-4f90-9909-3bd448c626a5
I/Unity (17795): Built from '2018.2/staging' branch, Version '2018.2.19f1 (06990f28ba00)', Build type 'Release', Scripting Backend 'mono'
E/Unity (17795): Unable to find ts3client_android
E/Unity (17795): AndroidJavaException: java.lang.ClassNotFoundException: com.teamspeak.unity.TeamSpeakWrapper
E/Unity (17795): java.lang.ClassNotFoundException: com.teamspeak.unity.TeamSpeakWrapper
E/Unity (17795): at java.lang.Class.classForName(Native Method)
E/Unity (17795): at java.lang.Class.forName(Class.java:306)
E/Unity (17795): at java.lang.Class.forName(Class.java:270)
E/Unity (17795): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
E/Unity (17795): at com.unity3d.player.UnityPlayer.c(Unknown Source)
E/Unity (17795): at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
E/Unity (17795): at android.os.MessageQueue.next(MessageQueue.java:211)
E/Unity (17795): at android.os.Looper.loop(Looper.java:122)
E/Unity (17795): at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
E/Unity (17795): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.teamspeak.unity.TeamSpeakWrapper" on path: DexPathList[[zip file "/data/app/com.Test.TeamSpeak-1/base.apk", zip file "/system/priv-app/MetricsApi/MetricsApi.apk", zip file "/system/priv-app/com.amazon.dp.logger/com.amazon.dp.logger.apk"],nativeLibraryDirectories=[/data/app/com.Test.TeamSpeak-1/lib/arm, /vendor/lib,
I also tried copying the two libraries from the armeabi-v7a folder up one folder and setting their platform info in the inspector to Android and ARMv7. That ends up getting them included in the .apk file under lib/armeabi-v7a. But I still get the same error, I think since it's looking for "ts3client_android" instead of "ts3client".
So I rename /Assets/Plugins/android/libts3client.so to libts3client_android.so. It then seems to at least stop complaining about finding ts3client_android, but still cannot find com.teamspeak.unity.TeamSpeakWrapper.
Code:
I/Unity (20122): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 1815mb
I/Unity (20122): SystemInfo ARM big.LITTLE configuration: 2 big (mask: 0xc), 2 little (mask: 0x3)
I/Unity (20122): ApplicationInfo com.Test.TeamSpeak version 0.1 build 06ef6193-0366-496f-a71b-32ff0263c641
I/Unity (20122): Built from '2018.2/staging' branch, Version '2018.2.19f1 (06990f28ba00)', Build type 'Release', Scripting Backend 'mono'
E/Unity (20122): AndroidJavaException: java.lang.ClassNotFoundException: com.teamspeak.unity.TeamSpeakWrapper
E/Unity (20122): java.lang.ClassNotFoundException: com.teamspeak.unity.TeamSpeakWrapper
E/Unity (20122): at java.lang.Class.classForName(Native Method)
E/Unity (20122): at java.lang.Class.forName(Class.java:306)
E/Unity (20122): at java.lang.Class.forName(Class.java:270)
E/Unity (20122): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
E/Unity (20122): at com.unity3d.player.UnityPlayer.c(Unknown Source)
E/Unity (20122): at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
E/Unity (20122): at android.os.MessageQueue.next(MessageQueue.java:211)
E/Unity (20122): at android.os.Looper.loop(Looper.java:122)
E/Unity (20122): at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
E/Unity (20122): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.teamspeak.unity.TeamSpeakWrapper" on path: DexPathList[[zip file "/data/app/com.Test.TeamSpeak-2/base.apk", zip file "/system/priv-app/MetricsApi/MetricsApi.apk", zip file "/system/priv-app/com.amazon.dp.logger/com.amazon.dp.logger.apk"],nativeLibraryDirectories=[/data/app/com.Test.TeamSpeak-2/lib/arm, /vendor/lib,
Any ideas? Are the android libraries included in the unity package maybe not the right ones? Can anyone else get this to build for Android, and if so, care to share how you did it?
Notes:
I've tried on a couple different Android devices (all ARMv7), and they act the same... so I don't think it's device specific.
I've also tried using Unity 5.5.6f1 and the TeamSpeak SDK for Unity 5.5 and get the same results... so I don't think it's Unity version specific.