Forum

Results 1 to 6 of 6
  1. #1
    Join Date
    December 2018
    Posts
    1

    SDK Unity Android Build Example

    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.

  2. #2
    Join Date
    January 2016
    Location
    Munich / Bavaria
    Posts
    16
    Hi Mytiope,

    I can reproduce your problem and I'm working now on a new version for Unity.
    I will add a link to this thread when i finished it

    Kind Regards,
    Alex

  3. #3
    Join Date
    June 2019
    Posts
    2
    Hello, I have the same problem. Could you give an advice how to solve it? I use Unity 2018.3.12f1 and TeamSpeak_SDK_3.0.4.4_2018_10_12_Unity3D_2018_2_f1 1.unitypackage.

  4. #4
    Join Date
    June 2019
    Posts
    2
    It seems that the last version does not have .jar file. The older version 3.0.3.2 works for me.

  5. #5
    Join Date
    October 2019
    Location
    somewhere unknown
    Posts
    1
    so, what is the result?

  6. #6
    Join Date
    November 2019
    Posts
    1

    Any news ?

    Hello,

    It's impossible to use the SDK on Unity Android because of this error.

    Is it possible to get any news on this thread ?

    I'm using Unity 2019.2.9f1

    To contribute, I managed to include the libs into the apk only when the .so are placed into this folder and with this configuration for both files :

    Click image for larger version. 

Name:	1.png 
Views:	11 
Size:	48.0 KB 
ID:	18537

    I also had to perform theses steps :

    - Uncheck all the checkbox
    - Apply
    - Check Android
    - Select ARMv7
    - Check Load on startup

    After the build, I got my libs into \lib\armeabi-v7a inside the apk :

    Click image for larger version. 

Name:	2.png 
Views:	8 
Size:	57.0 KB 
ID:	18538

    I also change the code from TeamSpeakInterface.cs, line 110, to match the .so filename and to prevent the lib not found.

    Click image for larger version. 

Name:	3.png 
Views:	10 
Size:	21.5 KB 
ID:	18539

    But it still not work (from logcat) :

    Code:
    11-01 14:12:06.940 11019 11041 I Unity   : 192.168.0.32
    11-01 14:12:06.940 11019 11041 I Unity   : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    11-01 14:12:06.940 11019 11041 I Unity   : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    11-01 14:12:06.940 11019 11041 I Unity   : UnityEngine.Logger:Log(LogType, Object)
    11-01 14:12:06.940 11019 11041 I Unity   : UnityEngine.Debug:Log(Object)
    11-01 14:12:06.940 11019 11041 I Unity   : TS3_Minimal_Mobile_Example:OnGUI() (at C:\Sources\EnkiRemote\EnkiRemote\Assets\TeamSpeak\Example\TS3_Minimal_Mobile_Example.cs:97)
    11-01 14:12:06.940 11019 11041 I Unity   :
    11-01 14:12:06.940 11019 11041 I Unity   : (Filename: C Line: 0)
    11-01 14:12:06.940 11019 11041 I Unity   :
    11-01 14:12:06.995 11019 11041 E Unity   : AndroidJavaException: java.lang.ClassNotFoundException: Didn't find class "com/teamspeak/unity/TeamSpeakWrapper" on path: DexPathList[[zip file "/data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/lib/arm, /data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]
    11-01 14:12:06.995 11019 11041 E Unity   : java.lang.ClassNotFoundException: Didn't find class "com/teamspeak/unity/TeamSpeakWrapper" on path: DexPathList[[zip file "/data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/lib/arm, /data/app/com.BiggerInside.EnkiRemote-z3rhVEWijxElI0dfcgAaZQ==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]
    11-01 14:12:06.995 11019 11041 E Unity   :      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    11-01 14:12:06.995 11019 11041 E Unity   :      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    11-01 14:12:06.995 11019 11041 E Unity   :      at com.unity3d.player.UnityPlayer.c
    @Ereona mentionned it works with and old sdk version.

    I manage to find a download link here :
    http://dl.4players.de/ts/releases/3.0.3.2/

    I succesfully connect to a 3.0.4.4 server once, but it was not stable, and app crashed.
    I also tried to import the jar from 3.0.3.2 to 3.0.4.4, but I had no luck.

    Please help !

    Thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: February 9th, 2018, 05:49 PM
  2. 3D Audio in Unity works on PC but not Android
    By jdwilder in forum General Questions
    Replies: 0
    Last Post: December 15th, 2016, 11:25 PM
  3. Unity C# SDK: onEditPlaybackVoiceDataEvent
    By Psiku in forum General Questions
    Replies: 3
    Last Post: July 11th, 2016, 09:57 AM
  4. unity 3d 3.3
    By moghazy in forum Client Support
    Replies: 0
    Last Post: July 11th, 2011, 09:14 PM
  5. Update rc1 build:14377 to rc1 build:14468
    By k3nZo in forum Linux / FreeBSD
    Replies: 11
    Last Post: June 3rd, 2011, 02:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •