The flutter tool cannot access the file - android

I try to run the Flutter project but there is an error
Flutter failed to write to a file at
"C:\Users\Dell\flutter-development\projects\flutter_complete_guide\ios\Runner\GeneratedPluginRegistrant.h". The flutter
tool cannot access the file.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current
user.
Versions:
Flutter 1.22.4,
Windows 10
I tried to create a Flutter project with cmd and android-studio but the result is the same.
I gave full permissions for ALL(Including Dell user) for flutter-sdk directory, flutter project and their subdirectories also.
Once try to build project from scratch with flutter create myapp
get next error
PS C:\src1\project> flutter create myapp
Recreating project myapp...
myapp\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
Failed to send crash report due to a network error: SocketException: OS Error: Access is denied.
, errno = 5, address = clients2.google.com, port = 63568
Oops; flutter has exited unexpectedly: "FileSystemException: Cannot copy file to 'C:\src1\project\myapp\android\app\src\main\res\mipmap-mdpi\ic_launcher.png', path =
'C:\src1\flutter\packages\flutter_tools\templates\app\android.tmpl\app\src\main\res\mipmap-mdpi\ic_launcher.png' (OS Error: Access is denied.
, errno = 5)".

Flutter failed to write to a file at
"C:\Users\Dell\flutter-development\projects\flutter_complete_guide\ios\Runner\GeneratedPluginRegistrant.h". The flutter
tool cannot access the file.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current
user.
Make sure that you have ownership rights over the flutter installation folder. Check this out.
OS Error: Access is denied.
, errno = 5
Error 5: Access denied is a known issue on Windows 10. This error
prevents you from installing software on your computer and accessing
or modifying certain files.
The reason for this issue is the non-availability of the permissions.
Windows 10 will prevent you from installing if you don’t have the
Administrator privileges or if your account is not the administrator
account.
Getting administrator privileges for your account on the computer solves this problem.

I spent 5 days just to fix this issue.
i reset my windows 10 and it didn't work.
i upgrade to windows 11 and hoping it might takeover the permission
or anything, but still didn't work.
until i tried to backup my flutter project to google drive and then
redownload it. it ends up work.
i guess to fix this issue you just need to reset the folder attribute by recreating every file. and in my case through cloud storage.

Related

Unable to create a flutter project on Android studio

I am trying to create a new flutter project on Andriod Studio but the following error is shown:
C:\Users\cvaa4\flutter\bin\flutter.bat doctor --verbose
This program is blocked by group policy. For more information, contact your system administrator.
Process finished with exit code 1
Any idea how to solve it?
Thanks
Your windows user has not permision to change(create) files in C:\Users\... you should have Admin user in windows.

Why can't both Gradle sync and internal http work in a fresh install of Android Studio?

I'm trying to install and start learning Android Development. I have tried a lot of things to get Android Studio working, but I simply can't!
There are 2 errors:
Gradle 'MyFirstApp' project refresh failed - Error:Protocol family
unavailable
and
Internal HTTP server disabled: Cannot start internal HTTP server. Git
integration, JavaScript debugger and LiveEdit may operate with errors.
Please check your firewall settings and restart Android Studio
Here what I already did:
For Gradle:
tried to uninstall deleting all folders and files regarding AS 1.5.1 and reinstall
checked for java environment variables
reinstall just gradle
For Internal HTTP:
disabled Kaspersky Internet Security (version 16.0.0.614(d))
checked if any other service or software could be using some known ports, disabled as much as I could
uninstall and try a fresh install as I did for gradle
Nothing works!
I always install with Kaspersky temporaly disabled and I run the installation package as administrator
Some data that might be useful:
SO: Windows 10 Pro (single language en-us)
Android Studio: 1.5.1 (android-studio-bundle-141.2456560-windows)
What else do you need?
Can anyone help me?
Thanks a lot!
UPDATE:
I have just installed on another computer running Windows 10 (home) 64bit with Java JDK 1.8 U 66 just like the first attempt, i.e., with both firewall & anti-virus software disabled and with administrator privileges.
The problem is exactly the same.
:(

Ionic project throws exception when run on android?

I'm trying execute an Ionic project on Android. When I try execute the project does throws an exception from cordova. Looking for a solution I found some peoples saying to set path of Android SDK, I made this but I still haven't any success. I added paths C:\Users\fernando\AppData\Local\Android\sdk\tools and C:\Users\fernando\AppData\Local\Android\sdk\platform-tools.
How could I solve it ?
Check your path of Android with ANDROID_HOME variable. This path should be the root of your SDK in the User variables. If it is not exist, add a new one.
Type $ android in the command line to check the SDK.
You also have to check if the API 19 has been installed.
Try to un-plug the device and re-plug again. Run the adb devices to make sure your device has been recognized by the computer.

Titanium permission denied building for Google Play Store

I have a problem where by I get a permission denied error when trying to package my Titanium app for the Google Play Store. The following is outputted to the console in Titanium Studio:
[INFO] : Writing build manifest: /Users/[my_home_folder]/projects/titanium/[App name]/build/android/build-manifest.json
/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/node_modules/wrench/lib/wrench.js:481
throw err;
^
Error: EACCES, permission denied '/Users/[my_home_folder]'
at fs.mkdirSync (fs.js:654:18)
at mkdirSyncRecursive (/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/node_modules/wrench/lib/wrench.js:466:12)
at mkdirSyncRecursive (/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/node_modules/wrench/lib/wrench.js:473:17)
at mkdirSyncRecursive (/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/node_modules/wrench/lib/wrench.js:473:17)
at Object.mkdirSyncRecursive (/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/node_modules/wrench/lib/wrench.js:473:17)
at cli.on.post (/Users/[my_home_folder]/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/android/cli/hooks/package.js:32:40)
at /usr/local/lib/node_modules/titanium/lib/hook.js:235:13
at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:551:21
at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:227:13
at iterate (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:134:13)
I'm building for Ti SDK 3.2.3 because I'm experiencing audio glitches with more recent versions of the SDK. I can build fine for both Android and iOS emulators and have packaged the iOS copy of the app for iTunes Connect. Anyone have any idea what the problem might be? Running Ti Studio 3.4.1 and CLI version 3.4.1 on OS X 10.9.5
It was my fault, the distribution path for the build was set to a folder in my home directory however there was a typo in my home directory's name. Titanium Studio had a green tick next to the path not because it was valid but simply cuz it was non-empty.
I noticed it suddenly while looking at the logs and was quick to fix, Ti should really give a more informative error message; it wasn't a permissions error, the path didn't exist.

Xamarin Android installation fails

I'm trying to install Xamarin for Android and I'm having a really weird issue and I can't find any help anywhere.
Once the installation starts and I click on Next button in the screen with the answer about if I want to collect information, it doesn't do anything. Checking the log file it always cancel the installation due to an internal error, I will copy the log section that's giving me the information:
[287C:256C][2013-01-13T14:02:06]: Caching bundle from: 'C:\Users\MAXIPO~1\AppData\Local\Temp\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\.be\XamarinSetup.exe' to: 'C:\ProgramData\Package Cache\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\XamarinSetup.exe'
[287C:256C][2013-01-13T14:02:07]: Registering bundle dependency provider: {e9ab888e-6304-4ba3-b36a-b1a350d36592}, version: 3.0.0.0
[2464:19E4][2013-01-13T14:02:07]: Prompt for source of container: WixAttachedContainer, path: C:\Soft\Android\XamarinSetup.exe
[2464:19E4][2013-01-13T14:02:07]: Failed to resolve source for file: C:\Soft\Android\XamarinSetup.exe, error: 0x80070642.
[2464:19E4][2013-01-13T14:02:07]: Error 0x80070642: Failed while prompting for source (original path 'C:\Soft\Android\XamarinSetup.exe').
[2464:19E4][2013-01-13T14:02:07]: Failed to acquire container: WixAttachedContainer to working path: C:\Users\MAXIPO~1\AppData\Local\Temp\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\4675EB82A6A7F3C48F80571AB6E8495BD1C803BA, error: 0x80070642.
[2464:2930][2013-01-13T14:02:07]: Error 0x80070642: Failed while caching, aborting execution.
Failed to resolve source for file : XamarinSetup.exe. This file doesn't exist ever, I've never found it even refreshing the folder over and over during installation in case it's deleted during the process. I can see it starts copying files into the temp folder, and suddenly all of them dissapear (I'm sure due to the cancellation). I'm running it in Windows 7, any idea? I've been looking for a solution for days even changing permissions in my system, giving access to guest, my user, administrator, and so worth to all the paths just in case.
Regards.
Despite of the problem itself I could finally install everything. Thanks to the Xamarin support I knew the automatic installation doesn't work always, so it's much better to install every package manually. So the instructions they gave me are the following ones:
It looks like a manual installation would get the trial version of Mono for Android installed. Please follow the below instructions:
Please download and install packages shown below in the order listed:
JDK 1.6: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html
Please choose the jdk-6u31-windows-i586.exe installer from the list above.
Android SDK: http://dl.google.com/android/installer_r20-windows.exe
After the main installer is done, please open the SDK Manager and install the following platform APIs: 7,8,10,12,14
GTK#: http://download.xamarin.com/Installer/gtk-sharp-2.12.10.win32.msi
MonoDevelop: http://download.xamarin.com/monodevelop/Windows/MonoDevelop-3.0.5.msi
Mono for Android SDK: http://download.xamarin.com/MonoforAndroid/Windows/mono-android-4.4.55.104956787.msi
You can skip steps 3 and 4 if you don't need/want to use MonoDevelop and use VisualStudio (2010 Professional or better) instead. In that case you must have VS installed before proceeding with step 5.
Always keep in mind to install the API's in the step 2, also JDK 1.6 is not the last one anymore so it will prompt you to install 1.7 instead of this one.

Categories

Resources