Exception: null. The flutter tool cannot access the file or directory - linux

I try to using Flutter in Ubuntu 18.04.5 LTS. with Android Studio 4.1.2.
When I try to run flutter app to a real device, I'm getting this error:
Exception: null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
The permissions output of the Flutter SDK:
-rw-rw-rw- 1 yacine yacine 10620 Feb 26 14:51 analysis_options.yaml
-rw-rw-rw- 1 yacine yacine 2879 Feb 26 14:51 AUTHORS
-drwxrwxrwx 4 yacine yacine 4096 Feb 26 14:51 bin
-rw-rw-rw- 1 yacine yacine 2723 Jan 25 20:42 CODE_OF_CONDUCT.md
-rw-rw-rw- 1 yacine yacine 711 Jan 25 20:42 CODEOWNERS
-rw-rw-rw- 1 yacine yacine 5184 Feb 26 14:51 CONTRIBUTING.md
-rw-rw-rw- 1 yacine yacine 1591 Feb 26 14:51 dartdoc_options.yaml
-drwxrwxrwx 15 yacine yacine 4096 Feb 26 14:51 dev
-drwxrwxrwx 13 yacine yacine 4096 Jan 25 20:45 examples
-rw-rw-rw- 1 yacine yacine 1731 Jan 25 20:42 flutter_console.bat
-rw-rw-rw- 1 yacine yacine 296 Jan 25 20:45 flutter_root.iml
-rw-rw-rw- 1 yacine yacine 1519 Jan 25 20:42 LICENSE
-drwxrwxrwx 13 yacine yacine 4096 Feb 26 14:51 packages
-rw-rw-rw- 1 yacine yacine 1107 Jan 25 20:42 PATENT_GRANT
-rw-rw-rw- 1 yacine yacine 4643 Feb 26 14:51 README.md
-rw-rw-rw- 1 yacine yacine 3342 Feb 26 14:51 SECURITY.md
-rw-rw-rw- 1 yacine yacine 14 Feb 26 15:55 version

Short answer: Change the permission of the flutter SDK folder + the permission of the project.
Long answer: After I try many things I found the solution for my problem: All what I try to do from the first time is to change the permission of my flutter SDK folder. But what I did not expect is to change the permission of my project ( Because I was using it without the appearance of this problem ). What I did to resolve the problem is to change the directory of my project from:
/media/yacine/File/Projects/Android/flutter_app
with this permission
drwxrwxr-x 1 yacine users 4096 Feb 26 18:37 flutter_app
to:
/home/yacine/flutter_app
with this permission
drwxrwxr-x 13 yacine yacine 4096 Feb 27 01:12 flutter_app

Related

GitHub Actions: Error when copying generated directory to Docker image

I am using GitHub Actions to build our NestJS application.
These are some of the steps in the GitHub Actions workflow:
- name: Build Nest application
run: npm run build
- run: ls -al
- name: Build the Docker image
run: docker build . --file github.Dockerfile
github.Dockerfile looks like this:
FROM node:14-alpine as app
WORKDIR /usr/home/app
COPY package.json ./
COPY src ./
COPY node_modules ./
The build fails with this error message:
Step 5/5 : COPY node_modules ./
COPY failed: stat /var/lib/docker/tmp/docker-builder535687818/node_modules: no such file or directory
When listing the directory contents with RUN ls -al, this is the result:
drwxr-xr-x 9 runner docker 4096 Sep 29 12:53 .
drwxr-xr-x 3 runner docker 4096 Sep 29 12:52 ..
-rw-r--r-- 1 runner docker 1541 Sep 29 12:52 .dockerignore
-rw-r--r-- 1 runner docker 663 Sep 29 12:52 .eslintrc.js
-rw-r--r-- 1 runner docker 1300 Sep 29 12:52 .gcloudignore
drwxr-xr-x 8 runner docker 4096 Sep 29 12:52 .git
drwxr-xr-x 3 runner docker 4096 Sep 29 12:52 .github
-rw-r--r-- 1 runner docker 388 Sep 29 12:52 .gitignore
-rw-r--r-- 1 runner docker 51 Sep 29 12:52 .prettierrc
-rw-r--r-- 1 runner docker 3370 Sep 29 12:52 README.md
-rw-r--r-- 1 runner docker 162 Sep 29 12:52 cloudbuild.yaml
drwxr-xr-x 2 runner docker 4096 Sep 29 12:53 dist
-rw-r--r-- 1 runner docker 102 Sep 29 12:52 github.Dockerfile
drwxr-xr-x 2 runner docker 4096 Sep 29 12:52 k8s
-rw-r--r-- 1 runner docker 64 Sep 29 12:52 nest-cli.json
drwxr-xr-x 134 runner docker 4096 Sep 29 12:53 node_modules
-rw-r--r-- 1 runner docker 521420 Sep 29 12:52 package-lock.json
-rw-r--r-- 1 runner docker 1923 Sep 29 12:52 package.json
-rw-r--r-- 1 runner docker 471 Sep 29 12:52 skaffold.Dockerfile
-rw-r--r-- 1 runner docker 446 Sep 29 12:52 skaffold.yaml
drwxr-xr-x 2 runner docker 4096 Sep 29 12:52 src
drwxr-xr-x 2 runner docker 4096 Sep 29 12:52 test
-rw-r--r-- 1 runner docker 97 Sep 29 12:52 tsconfig.build.json
-rw-r--r-- 1 runner docker 339 Sep 29 12:52 tsconfig.json
package.json and src are part of the Git repository. node_modules gets generated in the process of the GitHub Action.
Why can't node_modules be copied to the Docker container, while both package.json and src can?
It turned out node_modules was included in the .dockerignore file. 🤦🏻‍♂️

'uvloop' has no attribute 'EventLoopPolicy'

I am testing python code performance with uvloop. I am getting 'uvloop' has no attribute 'EventLoopPolicy' error.
I am using python 3.7 and
uvloop 0.13.0
pycharm
I tried changing interpreter reinstalling uvloop but none of them did not work.
Can anyone suggest what is the problem?
Rename your own file to something else than uvloop.py, such as test_uvloop.py.
You're confusing Python's import machinery by having your own file the same name as the library you're trying to use.
I see that you're on a Mac, but I just fixed this problem on my CentOS7.x server by properly setting permissions to the uvloop Python package. It's pesky because (at least on CentOS) some pip-installed Python packages go in /usr/local/lib/python3.7/site-packages and some go in /usr/local/lib64/python3.7/site-packages.
Check out what the files in my lib64 directory looked like before I fixed it:
me#myserver /usr/local/lib64/python3.7/site-packages
$ ll
total 16
drwxr-xr-x. 3 root root 4096 Jan 17 15:38 click
drwxr-xr-x. 2 root root 134 Jan 17 15:38 Click-7.0.dist-info
drwxr-x---. 4 root root 74 Jan 17 15:42 httptools
drwxr-x---. 2 root root 141 Jan 17 15:42 httptools-0.0.13-py3.6.egg-info
drwxr-x---. 3 root root 4096 Jan 17 15:43 pydantic
drwxr-x---. 2 root root 111 Jan 17 15:43 pydantic-1.3.dist-info
drwxr-x---. 5 root root 4096 Jan 17 15:43 uvloop
drwxr-x---. 2 root root 141 Jan 17 15:43 uvloop-0.14.0-py3.6.egg-info
drwxr-xr-x. 4 root root 4096 Jan 17 15:38 websockets
drwxr-xr-x. 2 root root 134 Jan 17 15:38 websockets-8.1.dist-info
Unless I was running as a root user the uvloop files are untouchable and that's what caused the error. On your Mac, try to find where your uvloop package is installed and make sure your script can access it.

How to update homebrew in preparation for installing node/npm on macOS Mojave

I attempted to install node.js/npm onto a macbook running Mojave 10.14.5 so that I can do local development of a web app. From internet research my understanding is the first step is updating homebrew in preparation for installation but I got the error "Error: /usr/local must be writable!" when I ran:
brew update
I searched the internet and other people appeared to have the command below fix the problem, but for me that didn't work and I still got the error.
sudo chown -R $(whoami) $(brew --prefix)/*
Can anyone offer any advice as to what I can do so that I can update brew and install node.js/npm? Is the brew update required or should I just skip that step?
Below is the output from brew --prefix that may help...
MacBook-Pro:usr dannyboy$ ls -l $(brew --prefix)
total 215896
-rw-r--r-- 1 dannyboy admin 3161 May 23 2016 CODEOFCONDUCT.md
drwxr-xr-x 5 dannyboy admin 160 Nov 4 2018 Cellar
-rw-r--r-- 1 dannyboy admin 1241 Jan 13 2016 LICENSE.txt
drwxr-xr-x 11 dannyboy admin 352 Nov 4 2018 Library
-rw-r--r-- 1 dannyboy admin 3918 May 23 2016 README.md
drwxrwxr-x 33 dannyboy admin 1056 Nov 4 2018 bin
drwxr-xr-x 3 dannyboy admin 96 Nov 4 2018 etc
lrwxr-xr-x 1 dannyboy admin 27 May 22 2016 hadoop -> /usr/local/hadoop-2.7.2-src
drwxr-xr-x# 22 dannyboy staff 704 Nov 4 2018 hadoop-2.7.2-src
-rw-r--r--# 1 dannyboy staff 110520320 May 22 2016 hadoop-2.7.2-src.tar
drwxrwxr-x 30 dannyboy admin 960 Nov 4 2018 include
drwxrwxr-x 23 dannyboy admin 736 Nov 4 2018 lib
drwxr-xr-x 5 dannyboy wheel 160 Nov 4 2018 man
lrwxr-xr-x 1 dannyboy wheel 27 Jan 18 2014 mysql -> mysql-5.6.15-osx10.7-x86_64
drwxr-xr-x 18 dannyboy wheel 576 Nov 4 2018 mysql-5.6.15-osx10.7-x86_64
-rw-r--r-- 1 dannyboy owner 1536 Jan 18 2014 mysql_db_backup_20140118.libertyrocks.tar
drwxr-xr-x 5 dannyboy admin 160 Nov 4 2018 opt
drwxr-xr-x 3 dannyboy wheel 96 Nov 4 2018 remotedesktop
drwxrwxr-x 9 dannyboy admin 288 Nov 4 2018 share
Also requested...
MacBook-Pro:usr dannyboy$ ls -l /usr
total 0
drwxr-xr-x 971 root wheel 31072 May 15 01:37 bin
drwxr-xr-x 307 root wheel 9824 May 15 01:37 lib
drwxr-xr-x 250 root wheel 8000 May 15 01:37 libexec
drwxr-xr-x 27 root wheel 864 Nov 4 2018 local
drwxr-xr-x 239 root wheel 7648 May 15 01:37 sbin
drwxr-xr-x 46 root wheel 1472 Nov 4 2018 share
drwxr-xr-x 5 root wheel 160 Sep 21 2018 standalone

Mongodb service fails after reboot

I am trying to setup a replicaset for my dev environment, and have three machines running debian 9.3 stretch with a mongod service. The replicaset is working, and all seems okay.
But when I reboot one of the servers the mongod service doesn't come up. When I check the status it says it failed status=48
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-08-28 22:17:37 CEST; 10s ago
Docs: https://docs.mongodb.org/manual
Process: 392 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=48)
Main PID: 392 (code=exited, status=48)
CPU: 33ms
aug 28 22:17:37 staging-manager-1 systemd[1]: Started MongoDB Database Server.
aug 28 22:17:37 staging-manager-1 mongod[392]: 2018-08-28T22:17:37.389+0200 I CONTROL [main] Automatically disabling TLS 1.0, to fo
aug 28 22:17:37 staging-manager-1 systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
aug 28 22:17:37 staging-manager-1 systemd[1]: mongod.service: Unit entered failed state.
aug 28 22:17:37 staging-manager-1 systemd[1]: mongod.service: Failed with result 'exit-code'.
I already enabled the service with systemctl enable mongod and in the status I can see that it is indeed enabled, but why does it fail after I reboot the machine?
update:
root#machine:/home/<user># journalctl -u mongod
-- Logs begin at Thu 2018-08-30 21:11:33 CEST, end at Thu 2018-08-30 21:26:42 CEST. --
aug 30 21:11:33 staging-manager-1 systemd[1]: Started MongoDB Database Server.
aug 30 21:11:33 staging-manager-1 mongod[398]: 2018-08-30T21:11:33.388+0200 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
aug 30 21:11:33 staging-manager-1 systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
aug 30 21:11:33 staging-manager-1 systemd[1]: mongod.service: Unit entered failed state.
aug 30 21:11:33 staging-manager-1 systemd[1]: mongod.service: Failed with result 'exit-code'.
root#machine:/home/<user># ll /etc/init
total 48
-rw-r--r-- 1 root root 278 mei 29 2017 anacron.conf
-rw-r--r-- 1 root root 1875 jul 18 21:01 docker.conf
-rw-r--r-- 1 root root 2493 jun 2 2015 networking.conf
-rw-r--r-- 1 root root 933 jun 2 2015 network-interface.conf
-rw-r--r-- 1 root root 530 jun 2 2015 network-interface-container.conf
-rw-r--r-- 1 root root 1756 jun 2 2015 network-interface-security.conf
-rw-r--r-- 1 root root 1359 mrt 14 2017 sddm.conf
-rw-r--r-- 1 root root 637 mrt 1 13:36 ssh.conf
-rw-r--r-- 1 root root 337 jun 13 22:20 udev.conf
-rw-r--r-- 1 root root 360 jun 13 22:20 udevmonitor.conf
-rw-r--r-- 1 root root 352 jun 13 22:20 udevtrigger.conf
-rw-r--r-- 1 root root 138 jan 23 2017 usb-modeswitch-upstart.conf
root#machine:/home/<user># ll /etc/init.d
total 168
-rwxr-xr-x 1 root root 5336 feb 1 2016 alsa-utils
-rwxr-xr-x 1 root root 2014 mei 29 2017 anacron
-rwxr-xr-x 1 root root 8181 apr 5 20:32 apache2
-rwxr-xr-x 1 root root 2489 mei 13 18:52 apache-htcacheclean
-rwxr-xr-x 1 root root 2401 jan 23 2017 avahi-daemon
-rwxr-xr-x 1 root root 2948 sep 13 2017 bluetooth
-rwxr-xr-x 1 root root 1904 nov 18 2015 cgroupfs-mount
-rwxr-xr-x 1 root root 1232 apr 7 2017 console-setup.sh
-rwxr-xr-x 1 root root 3049 okt 7 2017 cron
-rwxr-xr-x 1 root root 2816 jul 10 15:57 cups
-rwxr-xr-x 1 root root 1961 jan 19 2017 cups-browsed
-rwxr-xr-x 1 root root 2813 mrt 2 09:59 dbus
-rwxr-xr-x 1 root root 3843 jul 18 21:01 docker
-rwxr-x--- 1 root root 4285 jul 20 07:27 elasticsearch
-rwxr-xr-x 1 root root 3033 aug 9 21:30 gdm3
-rwxr-xr-x 1 root root 1604 feb 2 2017 gdomap
-rwxr-xr-x 1 root root 3809 mrt 7 19:29 hwclock.sh
-rwxr-xr-x 1 root root 1479 mei 19 2016 keyboard-setup.sh
-rwxr-xr-x 1 root root 2044 dec 26 2016 kmod
-rwxr-xr-x 1 root root 2241 apr 26 2017 minissdpd
-rwxr-xr-x 1 root root 4597 sep 16 2016 networking
-rwxr-xr-x 1 root root 1757 mrt 18 2017 network-manager
-rwxr-xr-x 1 root root 612 dec 4 2015 pppd-dns
-rwxr-xr-x 1 root root 1191 mei 17 12:56 procps
-rwxr-xr-x 1 root root 4355 dec 10 2017 rsync
-rwxr-xr-x 1 root root 2868 jan 18 2017 rsyslog
-rwxr-xr-x 1 root root 2330 mei 21 2017 saned
-rwxr-xr-x 1 root root 1222 apr 3 2017 screen-cleanup
-rwxr-xr-x 1 root root 1808 mrt 14 2017 sddm
-rwxr-xr-x 1 root root 2117 aug 2 2017 speech-dispatcher
-rwxr-xr-x 1 root root 2484 okt 12 2016 spice-vdagent
-rwxr-xr-x 1 root root 4033 mrt 1 13:36 ssh
-rwxr-xr-x 1 root root 731 jun 5 2017 sudo
-rwxr-xr-x 1 root root 6087 jun 13 22:20 udev
-rwxr-xr-x 1 root root 1391 mei 6 2017 unattended-upgrades
-rwxr-xr-x 1 root root 2757 nov 23 2016 x11-common
That is the whole output message?
Check if the default mongod port(27017) is not in use.
netstat -a
Or try starting in a different port
mongod --fork --port 8000
MongoDB defines exit code 48 as: "A newly started mongod or mongos could not start listening for incoming connections, due to an error."
You have pasted just the status output for the MongoDB service. For the full logs of a service on a systemd based system, you should review the systemd journal output:
journalctl -u mongod
As Lucca suggested, the problem may be something else is already running on the port when you are trying to start.
Check that you are't also trying to start MongoDB via Upstart or SysVInit by looking for MongoDB files in /etc/init and /etc/init.d. If any are found, move them somewhere else so that only the systemd service file is being used to start the service.
a#a-57:~$ sudo systemctl stop mongod.service
a#a-57:~$ sudo systemctl start mongod.service
a#a-57:~$ sudo systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-09 16:38:29 CST; 6s ago
Docs: https://docs.mongodb.org/manual
Main PID: 2205 (mongod)
CGroup: /system.slice/mongod.service
└─2205 /usr/bin/mongod --config /etc/mongod.conf
八 09 16:38:29 a-57 systemd[1]: Started MongoDB Database Server.
Somehow it's dangerous to edit the rc files under /etc in these modern days. And people would prefer to use system command API as we knew.
You need to edit etc/rc.local in order for it to start on boot up
Just add service mongod start to end of the rc.local file

OpenJDK-9 JDK not present on Ubuntu 17.10

I'm trying to install java 9 jre and jdk on ubuntu. But i cannot find it. I installed all the packages:
ii openjdk-9-jdk:amd64 9~b181-4 amd64 OpenJDK Development Kit (JDK)
ii openjdk-9-jdk-headless:amd64 9~b181-4 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-9-jre:amd64 9~b181-4 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-9-jre-headless:amd64 9~b181-4 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
Java -version returns:
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
javac -version:
javac 9-Ubuntu
But when I try to create JDK in new Intellij:
Then i get error:
I checked the content of /usr/lib/jvm/ and:
For java-8-openjdk-amd64:
drwxr-xr-x 7 root root 4096 gru 17 16:16 ./
drwxr-xr-x 4 root root 4096 gru 18 18:11 ../
lrwxrwxrwx 1 root root 22 paź 24 00:43 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4096 gru 17 16:16 bin/
lrwxrwxrwx 1 root root 41 paź 24 00:43 docs -> ../../../share/doc/openjdk-8-jre-headless/
drwxr-xr-x 3 root root 4096 gru 17 16:16 include/
drwxr-xr-x 5 root root 4096 gru 17 16:16 jre/
drwxr-xr-x 3 root root 4096 gru 17 16:16 lib/
drwxr-xr-x 4 root root 4096 gru 17 16:16 man/
lrwxrwxrwx 1 root root 20 paź 24 00:43 src.zip -> ../openjdk-8/src.zip
lrwxrwxrwx 1 root root 22 paź 24 00:43 THIRD_PARTY_README -> jre/THIRD_PARTY_README
For java-9-openjdk-amd64:
drwxr-xr-x 9 root root 4096 gru 18 18:11 ./
drwxr-xr-x 4 root root 4096 gru 18 18:11 ../
drwxr-xr-x 2 root root 4096 gru 18 18:11 bin/
drwxr-xr-x 4 root root 4096 gru 18 18:11 conf/
lrwxrwxrwx 1 root root 41 sie 24 19:15 docs -> ../../../share/doc/openjdk-9-jre-headless/
drwxr-xr-x 3 root root 4096 gru 18 18:11 include/
drwxr-xr-x 2 root root 4096 gru 18 18:11 jmods/
drwxr-xr-x 77 root root 4096 gru 18 18:11 legal/
drwxr-xr-x 5 root root 4096 gru 18 18:11 lib/
drwxr-xr-x 4 root root 4096 gru 18 18:11 man/
lrwxrwxrwx 1 root root 20 sie 24 19:15 src.zip -> ../openjdk-9/src.zip
My question is what went wrong? To install java-9 i used:
sudo apt install openjdk-9-jre openjdk-9-jdk
I found an issue on idea tracker
https://youtrack.jetbrains.com/issue/IDEA-178743
It's fixed. Also users suggested x86_64- version. Try with it.(source)

Resources