我用的是deepar(https://developer.deepar.ai/)结合Flutter。我正在为android创建一个Flutter插件。我使用jetpack支持库camerax访问摄像头。该库提供了一个名为“ImageAnalysis”的用例(https://developer.android.com/training/camerax/analyze). 我试着把这个和迪帕结合起来。我希望通过摄像头与deepar一起显示的遮罩作为资产在应用程序包中。当我调用“switcheffect”时,应用程序崩溃。
Flutter插件
Flutter插件的体系结构遵循Flutter文档中的建议。
class ExamplePlugin : FlutterPlugin, ActivityAware {
private var flutterPluginBinding: FlutterPluginBinding? = null
private var activityPluginBinding: ActivityPluginBinding? = null
// overrides are implemented but left out for simplicity
}
class PluginViewFactory(
private val flutterPluginBinding: FlutterPlugin.FlutterPluginBinding, private val activityPluginBinding: ActivityPluginBinding
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
override fun create(context: Context?, id: Int, args: Any?): PlatformView {
return PluginView(flutterPluginBinding, activityPluginBinding, context, id, args)
}
}
class PluginView(
flutterPluginBinding: FlutterPluginBinding,
activityPluginBinding: ActivityPluginBinding,
private val context: Context?,
id: Int,
args: Any?
) : PlatformView, MethodChannel.MethodCallHandler, PluginRegistry.RequestPermissionsResultListener,
AREventListener {
private val activity = activityPluginBinding.activity
// I left out some code for simplicity
创建processcameraprovider
private fun startCamera() {
val cameraProviderFuture = ProcessCameraProvider.getInstance(activity)
cameraProviderFuture.addListener({
cameraProvider = cameraProviderFuture.get()
bindPreviewAndAnalysis(cameraProvider)
}, ContextCompat.getMainExecutor(activity))
}
绑定图像预览和图像分析用例
private fun bindPreviewAndAnalysis(cameraProvider: ProcessCameraProvider?) {
// Preview
val imagePreview = Preview.Builder()
.build()
.also {
it.setSurfaceProvider(previewView.surfaceProvider)
}
// Analysis
val cameraPreset = CameraResolutionPreset.P1280x720
val width: Int
val height: Int
val orientation: Int = getScreenOrientation()
if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE || orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
width = cameraPreset.width
height = cameraPreset.height
} else {
width = cameraPreset.height
height = cameraPreset.width
}
arrayOfNulls<ByteBuffer>(NUMBER_OF_BUFFERS).also { buffers = it }
for (i in 0 until NUMBER_OF_BUFFERS) {
buffers[i] = ByteBuffer.allocateDirect(width * height * 3)
buffers[i]?.order(ByteOrder.nativeOrder())
buffers[i]?.position(0)
}
val imageAnalysis = ImageAnalysis.Builder().setTargetResolution(Size(width, height))
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST).build()
cameraExecutor?.let {
imageAnalysis.setAnalyzer(
it,
{ image ->
val byteData: ByteArray
val yBuffer: ByteBuffer = image.planes[0].buffer
val uBuffer: ByteBuffer = image.planes[1].buffer
val vBuffer: ByteBuffer = image.planes[2].buffer
val ySize: Int = yBuffer.remaining()
val uSize: Int = uBuffer.remaining()
val vSize: Int = vBuffer.remaining()
byteData = ByteArray(ySize + uSize + vSize)
//U and V are swapped
yBuffer.get(byteData, 0, ySize)
vBuffer.get(byteData, ySize, vSize)
uBuffer.get(byteData, ySize + vSize, uSize)
buffers[currentBuffer]?.put(byteData)
buffers[currentBuffer]?.position(0)
if (deepAR != null) {
deepAR?.receiveFrame(
buffers[currentBuffer],
image.width,
image.height,
image.imageInfo.rotationDegrees,
cameraSelector == CameraSelector.DEFAULT_FRONT_CAMERA,
DeepARImageFormat.YUV_420_888,
image.planes[1].pixelStride
)
}
currentBuffer = (currentBuffer + 1) % NUMBER_OF_BUFFERS
image.close()
})
}
try {
cameraProvider?.unbindAll()
cameraSelector?.let {
cameraProvider?.bindToLifecycle(activity as LifecycleOwner,
it, imagePreview, imageAnalysis)
}
} catch (e: Exception) {
Log.e(TAG, "Use case binding failed", e)
}
}
使用deepar开关效果
private fun changeMask(mask: String) {
try {
val loader = FlutterInjector.instance().flutterLoader()
val path = loader.getLookupKeyForAsset("assets/masks/$mask", "my_plugin_name")
val maskFd: AssetFileDescriptor = activity.assets.openFd(path)
deepAR?.switchEffect("masks", maskFd.createInputStream())
} catch (exc: Exception) {
Log.e(TAG, "Could not change mask", exc)
}
}
错误
调用“switcheffect”时,应用程序崩溃,出现以下错误:
F/libc (20852): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 20852 (.example.app), pid 20852 (.example.app)
************************************************
Build fingerprint: 'google/walleye/walleye:11/RP1A.201005.004.A1/6934943:user/release-keys'
Revision: 'MP1'
ABI: 'arm64'
Timestamp: 2021-07-25 13:59:29+0200
pid: 20852, tid: 20852, name: .example.app >>> com.example.app <<<
uid: 10194
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000007129de3570 x1 0000007129de3570 x2 0000007139e3b210 x3 0000007119769984
x4 0000007ff61c6788 x5 0000000000000000 x6 0000000000000001 x7 6ced3fea237c8a73
x8 0000000000000000 x9 6ced3fea237c8a73 x10 0000000000430000 x11 0000000029de3576
x12 000000005375645e x13 0000007ff61c68a0 x14 0000000000000002 x15 00000000ebad6a89
x16 00000073acaaa7f8 x17 00000073aabc5bd0 x18 00000073af972000 x19 0000007139e3b210
x20 0000007ff61c68b0 x21 00000071d9d95c70 x22 0000000000000001 x23 0000007ff61c68b4
x24 0000000000000000 x25 00000073af273000 x26 0000000000000069 x27 0000007119d77000
x28 0000007ff61c68c0 x29 0000007ff61c6890
lr 000000707f88e504 sp 0000007ff61c6850 pc 000000707f88e514 pst 0000000060000000
backtrace:
#00 pc 000000000004a514 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libnative-lib.so (Java_ai_deepar_ar_DeepAR_switchEffectRawNative+268) (BuildId: 342abf6bf48a1e62b230a5496cbaeecab0b6c701)
#01 pc 000000000013ced4 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: d0f321775158ed00df284edfabf672b6)
#02 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#03 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#04 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#05 pc 0000000000313288 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+696) (BuildId: d0f321775158ed00df284edfabf672b6)
#06 pc 000000000068b144 /apex/com.android.art/lib64/libart.so (MterpInvokeDirectRange+436) (BuildId: d0f321775158ed00df284edfabf672b6)
#07 pc 000000000012dc14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct_range+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#08 pc 0000000000162a36 [anon:dalvik-classes.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk] (ai.deepar.ar.DeepAR.switchEffect+70)
#09 pc 0000000000685960 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: d0f321775158ed00df284edfabf672b6)
#10 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#11 pc 000000000001a49c [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.changeMask+296)
#12 pc 0000000000687fe8 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: d0f321775158ed00df284edfabf672b6)
#13 pc 000000000012d914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#14 pc 000000000001a53a [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.changeMaskNative+42)
#15 pc 0000000000687fe8 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: d0f321775158ed00df284edfabf672b6)
#16 pc 000000000012d914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#17 pc 000000000001a962 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.onMethodCall+154)
#18 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#19 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#20 pc 000000000036ef32 [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage+34)
#21 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#22 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#23 pc 0000000000364daa [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart+114)
#24 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#25 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#26 pc 0000000000363a64 [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage+8)
#27 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#28 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#29 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#30 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#31 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#32 pc 000000000055c6f4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+468) (BuildId: d0f321775158ed00df284edfabf672b6)
#33 pc 000000000055c894 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: d0f321775158ed00df284edfabf672b6)
#34 pc 00000000004197f8 /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+656) (BuildId: d0f321775158ed00df284edfabf672b6)
#35 pc 000000000037deac /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2532) (BuildId: d0f321775158ed00df284edfabf672b6)
#36 pc 000000000036bc50 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+72) (BuildId: d0f321775158ed00df284edfabf672b6)
#37 pc 000000000132663c /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#38 pc 0000000001326578 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#39 pc 0000000001322408 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#40 pc 000000000138428c /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#41 pc 0000000001342568 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#42 pc 00000000013476f8 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#43 pc 000000000001a064 /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: b81fad2b6b7b7f85c6217d2cb80c9e61)
#44 pc 0000000000019c68 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: b81fad2b6b7b7f85c6217d2cb80c9e61)
#45 pc 00000000001120f4 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#46 pc 000000000020fadc /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: da25c976c2d1d3af123868772655a0779f8f6a48)
#47 pc 000000000200b6cc /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+204)
#48 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#49 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#50 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#51 pc 0000000000312228 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: d0f321775158ed00df284edfabf672b6)
#52 pc 00000000006856c0 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: d0f321775158ed00df284edfabf672b6)
#53 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#54 pc 0000000000396970 /system/framework/framework.jar (offset 0x92b000) (android.os.Looper.loop+156)
#55 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#56 pc 0000000000311840 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#57 pc 0000000000312b9c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1772) (BuildId: d0f321775158ed00df284edfabf672b6)
#58 pc 0000000000178658 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+58656) (BuildId: d0f321775158ed00df284edfabf672b6)
#59 pc 000000000013f7d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: d0f321775158ed00df284edfabf672b6)
#60 pc 00000000001a1698 /system/framework/framework.jar (android.app.ActivityThread.main)
#61 pc 00000000003095d8 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+528) (BuildId: d0f321775158ed00df284edfabf672b6)
#62 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#63 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#64 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: d0f321775158ed00df284edfabf672b6)
#65 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: d0f321775158ed00df284edfabf672b6)
#66 pc 000000000055ce14 /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1364) (BuildId: d0f321775158ed00df284edfabf672b6)
#67 pc 00000000004dba28 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+48) (BuildId: d0f321775158ed00df284edfabf672b6)
#68 pc 00000000000896f4 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 13577ce71153c228ecf0eb73fc39f45010d487f8)
#69 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#70 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#71 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#72 pc 0000000000312228 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: d0f321775158ed00df284edfabf672b6)
#73 pc 00000000006856c0 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: d0f321775158ed00df284edfabf672b6)
#74 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#75 pc 000000000044930a /system/framework/framework.jar (offset 0x125d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
#76 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#77 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#78 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#79 pc 0000000000897668 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2280) (BuildId: da25c976c2d1d3af123868772655a0779f8f6a48)
#80 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: d0f321775158ed00df284edfabf672b6)
#81 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: d0f321775158ed00df284edfabf672b6)
#82 pc 000000000055b830 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: d0f321775158ed00df284edfabf672b6)
#83 pc 000000000055bcf4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: d0f321775158ed00df284edfabf672b6)
#84 pc 000000000043ecbc /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+652) (BuildId: d0f321775158ed00df284edfabf672b6)
#85 pc 000000000009948c /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#86 pc 00000000000a0a0c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+844) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#87 pc 0000000000003570 /system/bin/app_process64 (main+1320) (BuildId: d4686d3f8282764488eb9ca7cc518583)
#88 pc 00000000000495b4 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: c78cdff5b820a550771130d6bde95081)
Lost connection to device.
环境
Kotlin1.5.20
Flutter2.2.3
迪帕尔2.4.1
camerax 1.1.0-alpha07/1.0.0-alpha27
附加说明
我在android仿真器(api级别30)和真正的android设备(pixel 2,android 11)上运行带有Flutter插件的Flutter应用程序时看到了这个错误。在调试模式和发布模式下运行Flutter应用程序时,我看到了这个错误。
欢迎提供任何帮助或建议。我刚开始从事flutter和android开发,所以我很有可能错过了一些重要的方面。
我还在deepar的github回购协议中发布了这个问题:https://github.com/deeparsdk/quickstart-android-java/issues/30
暂无答案!
目前还没有任何答案,快来回答吧!