Open farellsujanto opened 4 weeks ago
I'm using MacOS Sonoma 14.1.1 M1 chip
chmod +x priama-query-engine
You don't need to add permissions to the whole project. I just experimented with it. I just need to add x permissions to the engine.
Its still not working for me. Do you need to have admin acces on your mac device's user account? Because my user is not an administrator
@farellsujanto Is your project directory and running directory in your user directory? If not, then this is a matter of strict authority. You can either use the administrator account to authorize x permissions or run under your user directory.
I think my problem is, I don't know which prisma-query-engine is called on the app, because when I delete all prisma-query-engine from the project directory it still says Permission denied but there is no any of the engine remaining.
Is it possible to specify which prisma-query-engine location to be used on the app?
@farellsujanto
It will search three directories:
$PWD $PWD/prisma $PWD/.dart_tool
Engine files should exist in these three locations, otherwise an error of not finding the engine will be thrown instead of a permission error.
I've found something strange, my project location is at /Users/username/Desktop/app_name
, then I've searched the whole device for prisma-query-engine and I've found one on /Users/username/Library/Containers/com.example.appName/Data/prisma
When I tried to delete it it shows another error
Exception: No query engine binary found (prisma-query-engine) in [/Users/username/Library/Containers/com.example.appName/Data, /Users/username/Library/Containers/com.example.appName/Data/prisma, /Users/username/Library/Containers/com.example.appName/Data/.dart_tool]
Then I restore the deleted prisma-query-engine and add chmod +x to it, but it gives me another error
ProcessException: Operation not permitted
Just like what is reported on #326, I think its better if we have some freedom to use which prisma-query-engine that we wanted to use.
@farellsujanto Thanks for finding the key issue. I'm working on it, please pay attention to 👉 #379 and #328. I've done it iOS and Android platform.
The temporary solution is usually:
Upgrade orm
to 4.2 or higher
Use PrismaClient.use factory to create the client
Import BinaryEngine
from package:orm/engines/binary.dart
to re-specify the query engine path.
Notes: I'm working on the macOS integration of Flutter and orm normally, and I can directly rely on orm_flutter
to solve this problem when I'm done.
In addition, the root cause of this problem is that the engine is included in the app's data directory. Due to macOS's permission control, the commands in it cannot be run directly from the outside. You can put the binary engine into flutter assets and write it to the system temporary directory during the startup phase, and then run it.
Yeah I confirmed this is because of Directory.current
on macos app is different than other platform due to the strict rules. I'm able to solve my issue with your suggestions above.
I've also found out that you don't need to use the temporary solution that you gave above by removing the app sandboxing on XCode. I don't know yet the side effect of removing the sandboxing but it works fine without any changes on the code.
I'm developing windows & macos app, the windows one is already running well, but I got some problem when building the macos app. Already doing chmod +x & 777 on the entire project & builds but still not working.
I'm using
orm v4.1.0
I got this error
Here is the flutter doctor result
On release build its forced close but in debug build I got those error log, can you help me to solve this? Thanks!