Closed wantg closed 4 years ago
找不到对应的 libRongIMLib.so 一般都是 build.gradle 中没有指明 ndk 导致的,可以试着将 ndk 指定为 armeabi-v7a 详细可以参见 demo 中的配置 https://github.com/rongcloud/rongcloud-im-flutter-sdk/blob/master/example/android/app/build.gradle
@loginSin 谢谢回复,但似乎问题不是这个。 我编译官方example也一样,执行过程如下:
1.克隆代码
git clone https://github.com/rongcloud/rongcloud-im-flutter-sdk
2.进入 example 目录
cd example
3.修改 minSdkVersion 为 22(flutter_sound 1.8 需要)
4.安装依赖
flutter pub get
5.打包
flutter build apk
6.安装到手机 build\app\outputs\apk\release\app-release.apk (7.9MB)
7.用 Android Studio 看 logcat
结果仍然是
2020-01-07 16:17:05.059 18246-18246/? E/RongLog-Push[c]: appid or appkey can't be empty when enable MI push !
2020-01-07 16:17:05.059 18246-18246/? E/RongLog-Push[c]: appid or appkey can't be empty when enable MEIZU push !
2020-01-07 16:17:05.120 18298-18298/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.rongcloud_im_plugin_example:ipc, PID: 18298
java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/user/0/com.example.rongcloud_im_plugin_example/app_lib/libRongIMLib.so"
at java.lang.Runtime.load0(Runtime.java:914)
at java.lang.System.load(System.java:1508)
at io.rong.imlib.h.g.d()
at io.rong.imlib.h.f.c()
at io.rong.imlib.h.f.a()
at io.rong.imlib.h.c.a()
at io.rong.imlib.h.c.a()
at io.rong.imlib.NativeObject.<init>()
at io.rong.imlib.rc.a()
at io.rong.imlib.Ra.<init>()
at io.rong.imlib.ipc.RongService.onBind()
at android.app.ActivityThread.handleBindService(ActivityThread.java:3362)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1664)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
将 android/app/build.gradle 修改为如下配置可解决
android {
...
buildTypes {
release {
...
shrinkResources false
minifyEnabled false
}
}
...
}
日志