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

Failed to load dynamic library (dlopen failed: library "libkraken_jsc.so" not found) #209

Closed
CarlTien opened this issue Apr 23, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@CarlTien
Copy link

使用的 Kraken 版本 |0.7.1,按照官方文档的步骤去集成到原生android项目中直接报找不到.so文件,这个bridge如果是直接引入官方提供的sdk的话不用自己构建的吧?

flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library (dlopen failed: library "libkraken_jsc.so" not found)
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:55)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20:12)
#2 nativeDynamicLibrary (package:kraken/src/bridge/platform.dart:26:20)
#3 nativeDynamicLibrary (package:kraken/src/bridge/platform.dart)
#4 _registerDartMethods (package:kraken/src/bridge/from_native.dart:381:5)
#5 _registerDartMethods (package:kraken/src/bridge/from_native.dart)
#6 registerDartMethodsToCpp (package:kraken/src/bridge/from_native.dart:387:3)
#7 initBridge (package:kraken/src/bridge/bridge.dart:25:3)
#8 new KrakenViewController (package:kraken/src/launcher/controller.dart:107:20)
#9 new KrakenController (package:kraken/src/launcher/controller.dart:482:13)
#10 launch (package:kraken/src/launcher/launcher.dart:28:33)
#11 main (package:kraken_sdk_module/main.dart:4:3)
#12 _runMainZoned.. (dart:ui/hooks.dart:231:25)
#13 _rootRun (dart:async/zone.dart:1190:13)
#14 _CustomZone.run (dart:async/zone.dart:1093:19)
#15 _runZoned (dart:async/zone.dart:1630:10)
#16 runZonedGuarded (dart:async/zone.dart:1618:12)
#17 _runMainZoned. (dart:ui/hooks.dart:223:5)
#18 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
#19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

@CarlTien CarlTien added the bug Something isn't working label Apr 23, 2021
@andycall
Copy link
Member

是通过集成这个地址里面提供的 android release 包吗?

https://github.com/openkraken/kraken/releases/tag/0.7.1

@CarlTien
Copy link
Author

@CarlTien
Copy link
Author

直接在as里面构建运行会报错,但是如果打debug包再安装的话可以正常启动

@andycall
Copy link
Member

image
这个文件在 AAR 里面是存在的,是哪里的配置问题吗?

@CarlTien
Copy link
Author

image

@CarlTien
Copy link
Author

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/google/'
}
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/google/'
}
maven {
url 'https://storage.flutter-io.cn/download.flutter.io/'
}
maven {
url 'D:/code/soft/kraken/0.7.1/outputs/repo/'
}

}

}

task clean(type: Delete) {
delete rootProject.buildDir
}

build.gradle(:app)
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.123.456app"
    minSdkVersion 23
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    profile {
        initWith debug
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
debugImplementation 'com.openkraken.kraken.sdk:flutter_debug:0.7.1'
profileImplementation 'com.openkraken.kraken.sdk:flutter_profile:0.7.1'
releaseImplementation 'com.openkraken.kraken.sdk:flutter_release:0.7.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

@andycall
Copy link
Member

andycall commented Apr 23, 2021

从明天开始就要休假了

@wssgcg1213 求帮忙看下

@CarlTien
Copy link
Author

知道了,应该是架构的问题,我用的虚拟机是X86的,sdk里面没对应的.so文件

@andycall
Copy link
Member

OK

@eaglefly
Copy link

eaglefly commented Sep 7, 2021

kraken 默认将libkraken_jsc.so打到arm架构中,x86架构中没有,这个怎么解决啊? @andycall
按照这个https://openkraken.com/guide/native/interpolation-flutter 生成的,kraken: ^0.8.3

@andycall
Copy link
Member

andycall commented Sep 7, 2021

kraken 暂时不支持 android 虚拟机

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants