EricssonResearch / openwebrtc

A cross-platform WebRTC client framework based on GStreamer
http://www.openwebrtc.org
BSD 2-Clause "Simplified" License
1.8k stars 537 forks source link

android 7.0 JNI_GetCreatedJavaVMs failed #672

Closed nakyup closed 7 years ago

nakyup commented 7 years ago

03-06 16:39:23.540 25540-25540/kr.co.netseason.myclebot I/AudioManagerEx: AudioManagerEx created 03-06 16:39:23.540 25540-25540/kr.co.netseason.myclebot D/AudioManager: setMicrophoneMute() on= false Request Package= kr.co.netseason.myclebot 03-06 16:39:23.543 25540-25540/kr.co.netseason.myclebot D/AudioManager: setMicrophoneMute() on= true Request Package= kr.co.netseason.myclebot 03-06 16:39:23.665 25540-25540/kr.co.netseason.myclebot D/NativeCall: onJoinClicked 03-06 16:39:23.666 25540-25540/kr.co.netseason.myclebot V/OpenWebRTC: [3251]: created global ref: 0xa02 03-06 16:39:23.666 25540-25563/kr.co.netseason.myclebot I/OpenWebRTC: [474]: JNI: successfully attached to thread 03-06 16:39:23.666 25540-25563/kr.co.netseason.myclebot V/OpenWebRTC: [3248]: created weak global ref: 0x10085b 03-06 16:39:23.666 25540-25563/kr.co.netseason.myclebot V/OpenWebRTC: [3339]: got jobject[0x200009] from GObject[0xd6372830] 03-06 16:39:23.667 25540-25563/kr.co.netseason.myclebot V/OpenWebRTC: [3275]: finalizing global ref: 0xa02 03-06 16:39:23.667 25540-25540/kr.co.netseason.myclebot E/!!!: CameraSource getInstance is start 03-06 16:39:23.667 25540-25540/kr.co.netseason.myclebot E/!!!: instance is null 03-06 16:39:23.667 25540-25540/kr.co.netseason.myclebot E/!!!: CameraSourceImpl create 03-06 16:39:23.668 25540-25540/kr.co.netseason.myclebot E/!!!: CameraSourceImpl create Owr.getCaptureSources 03-06 16:39:23.668 25540-25540/kr.co.netseason.myclebot V/OpenWebRTC: [3251]: created global ref: 0x100a02 03-06 16:39:23.668 25540-25540/kr.co.netseason.myclebot E/!!!: CameraSourceImpl create latch.await 03-06 16:39:23.669 25540-25563/kr.co.netseason.myclebot I/g_log: dlsym("JNI_GetCreatedJavaVMs") failed: undefined symbol: JNI_GetCreatedJavaVMs 03-06 16:39:23.669 25540-25563/kr.co.netseason.myclebot I/g_log: get_jni_env_from_jvm: assertion 'jvm' failed

beginning of crash 03-06 16:39:23.670 25540-25563/kr.co.netseason.myclebot A/libc: owr_device_list.c:438: get_android_sdk_version: assertion "env" failed 03-06 16:39:23.670 25540-25563/kr.co.netseason.myclebot A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 25563 (Thread-11)

[ 03-06 16:39:23.671 480: 480 W/ ] debuggerd: handling request: pid=25540 uid=10262 gid=10262 tid=25563

i found it https://developer.android.com/about/versions/nougat/android-7.0-changes.html?hl=en

Here are some steps you can take to fix these types of errors and make sure your app doesn't crash on future platform updates:

If your app uses private platform libraries, you should update it to include its own copy of those libraries or use the public NDK APIs. If your app uses a third-party library that accesses private symbols, contact the library author to update the library. Make sure you package all your non-NDK libraries with your APK. Use standard JNI functions instead of getJavaVM and getJNIEnv from libandroid_runtime.so: AndroidRuntime::getJavaVM -> GetJavaVM from AndroidRuntime::getJNIEnv -> JavaVM::GetEnv or JavaVM::AttachCurrentThread from . Use __system_property_get instead of the private property_get symbol from libcutils.so. To do this, use __system_property_get with the following include:

include <sys/system_properties.h>

Note: The availability and contents of system properties is not tested through CTS. A better fix would be to avoid using these properties altogether.

Use a local version of the SSL_ctrl symbol from libcrypto.so. For example, you should statically link libcyrpto.a in your .so file, or include a dynamically linked version of libcrypto.so from BoringSSL/OpenSSL and package it in your APK.