You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a calculation in python using the gekko library and I need to use its result in my android app (written in kotlin).
I tested an example with matplotlib and it works just fine, but when I try getting the result for my calculation using gekko, i get the error com.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: '/data/data/com.jery.feedformulation6.debugXML/files/chaquopy/AssetFinder/requirements/gekko/bin/apm'
Stack Trace (here, optimization.py is my file with the calculation using gekko library):
10:52:35.501 System.err W com.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: '/data/data/com.jery.feedformulation6.debugXML/files/chaquopy/AssetFinder/requirements/gekko/bin/apm'
10:52:35.501 System.err W at <python>.subprocess._execute_child(subprocess.py:1704)
10:52:35.501 System.err W at <python>.subprocess.__init__(subprocess.py:858)
10:52:35.501 System.err W at <python>.gekko.gekko.solve(gekko.py:2097)
10:52:35.502 System.err W at <python>.optimization.optimization(optimization.py:38)
10:52:35.503 System.err W at <python>.chaquopy_java.call(chaquopy_java.pyx:354)
10:52:35.503 System.err W at <python>.chaquopy_java.Java_com_chaquo_python_PyObject_callAttrThrowsNative(chaquopy_java.pyx:326)
10:52:35.503 System.err W at com.chaquo.python.PyObject.callAttrThrowsNative(Native Method)
10:52:35.504 System.err W at com.chaquo.python.PyObject.callAttrThrows(PyObject.java:232)
10:52:35.504 System.err W at com.chaquo.python.PyObject.callAttr(PyObject.java:221)
10:52:35.505 System.err W at com.jery.feedformulation6.ui.activities.FeedsSelection.onCreate$lambda$0(FeedsSelection.kt:81)
10:52:35.506 System.err W at com.jery.feedformulation6.ui.activities.FeedsSelection.$r8$lambda$_9HgehKjBc5jWdqwGBEpBJxp6V4(Unknown Source:0)
10:52:35.506 System.err W at com.jery.feedformulation6.ui.activities.FeedsSelection$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
10:52:35.507 System.err W at android.view.View.performClick(View.java:7659)
10:52:35.507 System.err W at android.view.View.performClickInternal(View.java:7636)
10:52:35.507 System.err W at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
10:52:35.508 System.err W at android.view.View$PerformClick.run(View.java:30144)
10:52:35.508 System.err W at android.os.Handler.handleCallback(Handler.java:958)
10:52:35.509 System.err W at android.os.Handler.dispatchMessage(Handler.java:99)
10:52:35.510 System.err W at android.os.Looper.loopOnce(Looper.java:205)
10:52:35.510 System.err W at android.os.Looper.loop(Looper.java:294)
10:52:35.510 System.err W at android.app.ActivityThread.main(ActivityThread.java:8170)
10:52:35.510 System.err W at java.lang.reflect.Method.invoke(Native Method)
10:52:35.510 System.err W at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
10:52:35.511 System.err W at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
The text was updated successfully, but these errors were encountered:
jeryjs
changed the title
PermissionError: [Errno 13] Permission denied
gekko: PermissionError: [Errno 13] Permission denied
Sep 14, 2023
Unfortunately I don't think there's any easy way to use this package on Android. It bundles some executables for Linux, Mac and Windows, but not for Android. And an Android executable wouldn't work anyway, because of #605.
If anyone else wants this package too, let us know by clicking the thumbs-up button above.
I see...
I was able to get the app to finally work by setting remote=true in my .py file
Now it works, but just the time it takes to solve is too long rn (it takes abt 10-15 secs while remote=true but less than a second otherwise).
Chaquopy version
14.0.2
Devices or emulators where the issue happens
SM-M526B - API 33 (arm-v8a)
Android Studio Emulator - API 34 (x86_64)
Android Studio Emulator - API 29 (x86)
Relevant parts of your code
build.gradle:
MainActivity.kt:
And in manifest, I've given these permissions-
Describe your issue
I have a calculation in python using the gekko library and I need to use its result in my android app (written in kotlin).
I tested an example with matplotlib and it works just fine, but when I try getting the result for my calculation using gekko, i get the error
com.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: '/data/data/com.jery.feedformulation6.debugXML/files/chaquopy/AssetFinder/requirements/gekko/bin/apm'
Stack Trace (here, optimization.py is my file with the calculation using gekko library):
The text was updated successfully, but these errors were encountered: