gpt4 book ai didi

android - 在android Lollipop 上启动应用程序时强制关闭

转载 作者:行者123 更新时间:2023-11-29 14:48:19 29 4
gpt4 key购买 nike

请帮助我,我在我的应用程序中使用 sinch sdk,它在除 android lollipop 之外的所有 android 平台上正常运行,当我尝试打开它时它会强制关闭。这是日志:

12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: attempt to return an instance of com.sinch.android.rtc.internal.natives.jni.NativeServiceProviderImpl from com.sinch.android.rtc.internal.natives.jni.NativeServiceProviderImpl com.sinch.android.rtc.internal.natives.jni.ServiceProviderFactory.createServiceProvider(com.sinch.android.rtc.internal.service.dispatcher.Dispatcher, com.sinch.android.rtc.internal.service.http.HttpService, com.sinch.android.rtc.internal.service.pubnub.PubSubClient, com.sinch.android.rtc.internal.service.uniqueid.UniqueId, com.sinch.android.rtc.internal.service.crypto.CryptoService, com.sinch.android.rtc.internal.service.persistence.PersistenceService)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] from com.sinch.android.rtc.internal.natives.jni.NativeServiceProviderImpl com.sinch.android.rtc.internal.natives.jni.ServiceProviderFactory.createServiceProvider(com.sinch.android.rtc.internal.service.dispatcher.Dispatcher, com.sinch.android.rtc.internal.service.http.HttpService, com.sinch.android.rtc.internal.service.pubnub.PubSubClient, com.sinch.android.rtc.internal.service.uniqueid.UniqueId, com.sinch.android.rtc.internal.service.crypto.CryptoService, com.sinch.android.rtc.internal.service.persistence.PersistenceService)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x86eafef0 self=0xb4e07800
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] | sysTid=5423 nice=-11 cgrp=apps sched=0/0 handle=0xb6f5aec8
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] | state=R schedstat=( 284397663 94742126 1467 ) utm=18 stm=10 core=2 HZ=100
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] | stack=0xbe5dc000-0xbe5de000 stackSize=8MB
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext)+23)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #1 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext)+8)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #2 pc 00244bd9 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream >&, int, char const, art::mirror::ArtMethod)+68)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #3 pc 0022997f /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream >&) const+146)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #4 pc 000b0cdb /system/lib/libart.so (art::JniAbort(char const, char const)+582)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #5 pc 000b1415 /system/lib/libart.so (art::JniAbortF(char const, char const, ...)+60)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #6 pc 002634ff /system/lib/libart.so (art::CheckReferenceResult(art::mirror::Object, art::Thread)+486)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #07 pc 000874f3 /system/lib/libart.so (art::JniMethodEndWithReference(_jobject, unsigned int, art::Thread)+62)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] native: #08 pc 002dfdf1 /data/dalvik-cache/arm/data@app@com.galsa.example-2@base.apk@classes.dex (Java_com_sinch_android_rtc_internal_natives_jni_ServiceProviderFactory_createServiceProvider__Lcom_sinch_android_rtc_internal_service_dispatcher_Dispatcher_2Lcom_sinch_android_rtc_internal_service_http_HttpService_2Lcom_sinch_android_rtc_internal_service_pubnub_PubSubClient_2Lcom_sinch_android_rtc_internal_service_uniqueid_UniqueId_2Lcom_sinch_android_rtc_internal_service_crypto_CryptoService_2Lcom_sinch_android_rtc_internal_service_persistence_PersistenceService_2+240)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.sinch.android.rtc.internal.natives.jni.ServiceProviderFactory.createServiceProvider(Native method)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.sinch.android.rtc.internal.service.serviceprovider.DefaultServiceProvider.(DefaultServiceProvider.java:24)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.sinch.android.rtc.internal.client.DefaultSinchClient.(DefaultSinchClient.java:147)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClientFactory.java:17)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] - locked (a java.lang.Class)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at call.SinchClientService.startSinchClient(SinchClientService.java:194)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at call.SinchClientService.onCreate(SinchClientService.java:138)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.app.ActivityThread.handleCreateService(ActivityThread.java:3102)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.app.ActivityThread.access$1900(ActivityThread.java:172)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1505)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.os.Handler.dispatchMessage(Handler.java:102)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.os.Looper.loop(Looper.java:145)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at android.app.ActivityThread.main(ActivityThread.java:5834)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke!(Native method)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke(Method.java:372)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
12-26 01:33:00.577: A/art(5423): art/runtime/check_jni.cc:65]

帮助将不胜感激。

最佳答案

我假设您只在 Galaxy S5 上看到这个,如果没有,请告诉我。

根据我的研究,三星对安装过程(dex2oat 等)或 ART 做了一些,使其表现与其他制造商不同。

无论出于何种原因,对于给定的类 A,与从普通 Java 实例化的对象相比,从 JNI 层实例化的任何对象都被报告为属于不同的类。
这在禁用 CheckJNI 时工作正常,因为这些类实际上是相同的,但是当启用 CheckJNI 时它会提示(调试时似乎从 S5 上的 JNI 层实例化的任何类实际上是不同 dexcache 的一部分——这不是例如,运行 L 的 Nexus 5)。

TL;DR:CheckJNI 似乎在使用 Android L 的 S5 上出现故障。在 Release模式下构建应用程序会禁用 CheckJNI,一切都按预期工作。

关于android - 在android Lollipop 上启动应用程序时强制关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27659451/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com