Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proguard Rules for Azure Communication Library #69

Closed
shipon-eye opened this issue Oct 18, 2020 · 5 comments
Closed

Proguard Rules for Azure Communication Library #69

shipon-eye opened this issue Oct 18, 2020 · 5 comments
Assignees
Labels
Calling Issue involves Calling functionality. iOS Issues involving the iOS SDK

Comments

@shipon-eye
Copy link

We have developed an Android video chat application using Azure Communication Service. It is working successfully in Debug mode. But when we make release build, the app crashes when we initialize a call.

We are using 'com.azure.android:azure-communication-calling:1.0.0-beta.2'

Parts of Error Message:
CallClient: Native library $nativeLib failed to load during initialization.
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xpertmemos.inpocket-6QXGEXeOIs3FFbOF1JHg5g==/base.apk"],nativeLibraryDirectories=[/data/app/com.xpertmemos.inpocket-6QXGEXeOIs3FFbOF1JHg5g==/lib/arm, /data/app/com.xpertmemos.inpocket-6QXGEXeOIs3FFbOF1JHg5g==/base.apk!/lib/armeabi-v7a, /system/lib, /system/product/lib]]] couldn't find "libskypert.so"
2020-10-18 13:44:16.184 28108-28108/? E/CallClient: Native library $nativeLib failed to load during initialization.

No implementation found for com.azure.communication.calling.status com.azure.communication.calling.NativeLibrary.sam_call_client_create(com.azure.communication.calling.Out) (tried Java_com_azure_communication_calling_NativeLibrary_sam_1call_1client_1create and Java_com_azure_communication_calling_NativeLibrary_sam_1call_1client_1create__Lcom_azure_communication_calling_Out_2)

So far, we think it may be proguard rules issue.
Please help us to resolve this issue.

Regards
Habib

@RinaRish RinaRish added the Calling Issue involves Calling functionality. label Oct 19, 2020
@kagbakpem
Copy link
Member

Hello Habib,

Thanks for reaching out and glad to see you trying out the Azure Communication Services Calling SDK. The Calling SDK does not currently support ABIs armeabi-v7a and x86. It looks like you're attempting to use the library on an armeabi-v7a compatible device which will currently not work. Can you try a device/emulator with arm64-v8a or x86 ABI and report back if you're experiencing issues with these ABIs as well?
Thanks,
Komivi

@RinaRish RinaRish self-assigned this Oct 19, 2020
@shipon-eye
Copy link
Author

Hello Komivi,
Thanks for the answer.
By the way, I have tried with arm64-v8a and found following new errors:

2020-10-20 16:12:01.565 31363-31363/? W/System.err: java.lang.ClassNotFoundException: Didn't find class "com.skype.rt.RootToolsHandler" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/base.apk"],nativeLibraryDirectories=[/data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64, /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/base.apk!/lib/arm64-v8a, /system/lib64]]
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.Runtime.nativeLoad(Native Method)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.Runtime.loadLibrary0(Runtime.java:1014)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.System.loadLibrary(System.java:1669)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.azure.communication.calling.s.loadNativeLibraries(Unknown Source:16)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.azure.communication.calling.s.(Unknown Source:8)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.xpertlabbd.azure_meet.j.g(Unknown Source:14)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.xpertlabbd.azure_meet.j.call(Unknown Source:11)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.xpertlabbd.azure_meet.r.onMethodCall(Unknown Source:123)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(Unknown Source:17)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(Unknown Source:57)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at android.os.MessageQueue.next(MessageQueue.java:326)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at android.os.Looper.loop(Looper.java:160)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6923)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
2020-10-20 16:12:01.566 31363-31363/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)

--------- beginning of crash

2020-10-20 16:12:01.566 31363-31363/? A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 31363 (tmemos.inpocket), pid 31363 (tmemos.inpocket)
2020-10-20 16:12:01.692 31485-31485/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2020-10-20 16:12:01.693 1442-1442/? I//system/bin/tombstoned: received crash request for pid 31363
2020-10-20 16:12:01.694 31485-31485/? I/crash_dump64: performing dump of process 31363 (target tid = 31363)
2020-10-20 16:12:01.710 31485-31485/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: Build fingerprint: 'motorola/ocean/ocean:9/PPOS29.114-134-13/6abfe:user/release-keys'
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: Revision: 'PVT1'
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: ABI: 'arm64'
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: pid: 31363, tid: 31363, name: tmemos.inpocket >>> com.xpertmemos.inpocket <<<
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x0 0000000000000000 x1 0000000000007a83 x2 0000000000000006 x3 0000000000000004
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x4 000000006e69616d x5 000000006e69616d x6 000000006e69616d x7 000000006e69616d
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x8 0000000000000083 x9 0000000000000000 x10 0000000000000000 x11 000000000000000c
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x12 0000000000000000 x13 0000000000000001 x14 00000000000000c0 x15 0000000000000004
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x16 000000719a62f6e0 x17 000000719a5af120 x18 0000000012f7ed20 x19 00000071170e8460
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x20 00000070f4085fa4 x21 00000071170c8a40 x22 000000719c9f45e0 x23 0000007fc6d02c9c
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x24 00000070f3e59884 x25 00000000000000b1 x26 00000070f6b21820 x27 0000007117014c00
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: x28 00000071170e8460 x29 0000007fc6d02960
2020-10-20 16:12:01.711 31485-31485/? A/DEBUG: sp 0000007fc6d02960 lr 00000070f3e91f78 pc 000000719a5af128
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: backtrace:
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #00 pc 000000000006f128 /system/lib64/libc.so (tgkill+8)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #1 pc 0000000000101f74 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #2 pc 00000000000c5ec0 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #3 pc 00000000000cc2ec /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #4 pc 00000000000c96ec /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #5 pc 00000000000c9560 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #6 pc 00000000000c98d4 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/lib/arm64/libskypert.so (JNI_OnLoad+80)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #7 pc 00000000002e9d10 /system/lib64/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, _jobject*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>)+3192)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #8 pc 0000000000004038 /system/lib64/libopenjdkjvm.so (JVM_NativeLoad+412)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #9 pc 0000000000114bc8 /system/framework/arm64/boot-core-oj.oat (offset 0x114000) (java.lang.Runtime.nativeLoad [DEDUPED]+200)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #10 pc 0000000000184e0c /system/framework/arm64/boot-core-oj.oat (offset 0x114000) (java.lang.Runtime.loadLibrary0+188)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #11 pc 000000000018a8b0 /system/framework/arm64/boot-core-oj.oat (offset 0x114000) (java.lang.System.loadLibrary+96)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #12 pc 0000000000556c4c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #13 pc 00000000000cf8e8 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread
, unsigned int*, unsigned int, art::JValue*, char const*)+232)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #14 pc 000000000028058c /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #15 pc 000000000027a594 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #16 pc 0000000000527b4c /system/lib64/libart.so (MterpInvokeStatic+204)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #17 pc 0000000000549194 /system/lib64/libart.so (ExecuteMterpImpl+14612)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #18 pc 00000000002751dc /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (com.azure.communication.calling.s.loadNativeLibraries+32)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #19 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.760 31485-31485/? A/DEBUG: #20 pc 0000000000259d8c /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #21 pc 000000000027a578 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #22 pc 0000000000527b4c /system/lib64/libart.so (MterpInvokeStatic+204)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #23 pc 0000000000549194 /system/lib64/libart.so (ExecuteMterpImpl+14612)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #24 pc 0000000000275090 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (com.azure.communication.calling.s.+16)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #25 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #26 pc 0000000000259d8c /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #27 pc 000000000027a578 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #28 pc 0000000000527988 /system/lib64/libart.so (MterpInvokeDirect+296)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #29 pc 0000000000549114 /system/lib64/libart.so (ExecuteMterpImpl+14484)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #30 pc 0000000000476bc4 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (com.xpertlabbd.azure_meet.j.g+28)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #31 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #32 pc 0000000000259d8c /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #33 pc 000000000027a578 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #34 pc 0000000000527988 /system/lib64/libart.so (MterpInvokeDirect+296)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #35 pc 0000000000549114 /system/lib64/libart.so (ExecuteMterpImpl+14484)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #36 pc 0000000000476b4e /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (com.xpertlabbd.azure_meet.j.call+22)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #37 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #38 pc 0000000000259d8c /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #39 pc 000000000027a578 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #40 pc 000000000052968c /system/lib64/libart.so (MterpInvokeVirtualQuick+584)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #41 pc 000000000054cd94 /system/lib64/libart.so (ExecuteMterpImpl+29972)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #42 pc 000000000047698e /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (com.xpertlabbd.azure_meet.r.onMethodCall+246)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #43 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #44 pc 0000000000259d8c /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #45 pc 000000000027a578 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #46 pc 00000000005275c4 /system/lib64/libart.so (MterpInvokeInterface+1392)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #47 pc 0000000000549214 /system/lib64/libart.so (ExecuteMterpImpl+14740)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #48 pc 000000000048fbb2 /data/app/com.xpertmemos.inpocket-iZ8YADsfac-vZvbU0FYhGA==/oat/arm64/base.vdex (io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage+34)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #49 pc 0000000000254298 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1797368847+488)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #50 pc 0000000000516edc /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #51 pc 000000000055fafc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
2020-10-20 16:12:01.761 31485-31485/? A/DEBUG: #52 pc 0000000000004554 /dev/ashmem/dalvik-jit-code-cache (deleted)
2020-10-20 16:12:02.154 2032-31488/? W/ActivityManager: Force finishing activity com.xpertmemos.inpocket/.MainActivity

Thanks
Habib

@tompi
Copy link

tompi commented Oct 20, 2020

@shipon-eye NOW you are on the R8 stripped away classes I think :)

Here is my proguard file, which seem to work.
(you can probably strip more, but I didnt bother)

-keep class com.skype.rt.** {*;}
-keep class com.azure.** {*;}
-keep class com.skype.android.** {*;}
-keep class com.microsoft.media.** {*;}
-keep class com.microsoft.dl.** {*;}

@kagbakpem
Copy link
Member

Right @tompi, that's the issue indeed. I missed portion of @shipon-eye message where he mentioned the issue was specifically with the release build type. These proguard rules will definitely work out. Give it a try and let us know if you're still experiencing isssues, @shipon-eye.
Thanks @tompi.

@shipon-eye
Copy link
Author

Thanks a lot, @tompi. Yes, it works now.
Also thank you @komivi for drawing attention to current ABIs support of Communication SDKs.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 20, 2020
@mariusu-msft mariusu-msft added the iOS Issues involving the iOS SDK label Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Calling Issue involves Calling functionality. iOS Issues involving the iOS SDK
Projects
None yet
Development

No branches or pull requests

5 participants