Closed kmf909 closed 4 years ago
The stack trace is incomplete, as it only includes the Dart stack trace, not the Java one. I'm sure there must be some way to configure Flutter to log that.
I don't know what Python libraries you're using, but when this message appears as a fatal exception it's usually because the program is trying to use the multiprocessing synchronization functions, which aren't available on Android. Some libraries attempt to check for this but catch the wrong exception type, in which case you might be able to find a workaround like https://github.com/chaquo/chaquopy/issues/232#issuecomment-594637201.
we are using numpy, scikit-learn, pandas, joblib, tensorflow , keras. Unfortunately the workaround is not working with our case.
this is stack trace for Kotlin.
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: com.chaquo.python.PyException: ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.multiprocessing.synchronize.<module>(synchronize.py:30)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.zipimport.load_module(<frozen zipimport>:259)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.java.chaquopy.import_override(import.pxi:60)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.joblib.externals.loky.backend.<module>(__init__.py:13)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.java.chaquopy.import_override(import.pxi:60)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.joblib.externals.loky.<module>(__init__.py:11)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.java.chaquopy.import_override(import.pxi:60)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.joblib.parallel.<module>(parallel.py:31)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.java.chaquopy.import_override(import.pxi:60)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.joblib.<module>(__init__.py:120)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.java.chaquopy.import_override(import.pxi:60)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.flobo.<module>(flobo.py:1)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap._call_with_frames_removed(<frozen importlib._bootstrap>:219)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap_external.exec_module(<frozen importlib._bootstrap_external>:783)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:671)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:975)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:991)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib._bootstrap._gcd_import(<frozen importlib._bootstrap>:1014)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.importlib.import_module(__init__.py:127)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at <python>.chaquopy_java.Java_com_chaquo_python_Python_getModule(chaquopy_java.pyx:153)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at com.chaquo.python.Python.getModule(Native Method)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at org.mimos.flobo.MainActivity$onCreate$1.onMethodCall(Unknown Source:259)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(Unknown Source:17)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(Unknown Source:57)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at android.os.MessageQueue.nativePollOnce(Native Method)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at android.os.MessageQueue.next(MessageQueue.java:363)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at android.os.Looper.loop(Looper.java:173)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at android.app.ActivityThread.main(ActivityThread.java:8178)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at java.lang.reflect.Method.invoke(Native Method)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
03-11 08:55:29.629 1956 1956 E MethodChannel#flobo_chaquopy: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
OK, you can probably work around this by using an older version of joblib: see https://github.com/chaquo/chaquopy/issues/21#issuecomment-448569425.
yaaahhh... thanks mr @mhsmith , problem solved.
If you're using Chaquopy 8.0.1 or later, there's no longer any need to use old versions of librosa or joblib.
To upgrade, edit your app's top-level build.gradle file and change the version number of com.chaquo.python:gradle
.
Hi, this issue related to email that out team member (hamraa.osatechnology@gmail.com) send to you on 20 Feb 2020. below is the log. A bit of a background, our team develop an android app using flutter, the issue were the app working during debug mode but when we build apk and install the app it does not produce result from the python code.