Permission is being denied on Flutter project - android-studio

I don't know why I'm getting this error when I am running my project I would appreciate if some one could help me. I'm new to Flutter and Android Studio.
flutter doctor
[✓] Flutter (Channel beta, v1.11.0, on Mac OS X 10.15.3 19D76, locale en-GB)
• Flutter version 1.11.0 at /Users/tobiadegoroye/flutter
• Framework revision 856a90e67c (4 months ago), 2019-11-08 18:00:01 -0800
• Engine revision af04338413
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/tobiadegoroye/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[!] IntelliJ IDEA Community Edition (version 2019.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
! Doctor found issues in 2 categories.

It's likely that gradlew isn't set as an executable on your machine, and causes ProcessException: Permission Denied errors. Try running chmod +x gradlew on your Mac OS.

Related

Sudden Error appears when debugging and hot reloading the app

I'm super confused right now. Following error just appeared when I was debugging some parts of my app and suddendly came out of nowhere when I pressed hot reload:
Running "flutter pub get" in storeangels...
Could not find a file named "pubspec.yaml" in "/Users/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1".
pub get failed (66; Could not find a file named "pubspec.yaml" in "/Users/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1".)
Error
This is what I found when I searched for the shared_preferences_linux stuff
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-GB)
• Flutter version 1.17.5 at /Users/flutter
• Framework revision 8af6b2f038 (5 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/hottube/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
If someone know what to do here I'd really appreciate it
Did you try flutter clean ? This fixed many bugs that I had.
Alright, a colleague was able to give me the solution for my problem.
I had to write following command in the terminal in android studio:
flutter pub pub cache repair
This fixed the bug for me.

Uploading a Flutter project to Github using Android Studio

I am creating an app using Flutter with Andriod Studio. I am trying to upload a project to GitHub using the VCS 'Import into Version Control' to create a repository for the program but it keeps getting stuck with an error saying that the file is too big to upload to GitHub. I'm not sure why this is the case as it's not a very large program and I've cloned a file similar in size to this one from GitHub before.
(I'm using a MacBook Pro)
Thanks in advance for any help.
Also here is the flutter doctor output
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15.1 19B88, locale en-GB)
• Flutter version 1.9.1+hotfix.5 at /Users/AdamWood/Developer/flutter
• Framework revision 1aedbb1835 (9 weeks ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/AdamWood/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3, Build version 11C29
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
Process finished with exit code 0
try to import the proyect with nothing, and make your first commit with all the proyect files

Option to create a new Flutter project is missing after upgrade of Android Studio (3.4) and Flutter Plugin (38.2.1)

After upgrading Android Studio to (3.4) and my Flutter Plugin to (38.2.1), the option to create a new project is missing from the Android Studio startup screen. I've tried the following things detailed below. Any suggestions to fix this would be greatly appreciated.
Flutter Doctor Summary
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-US)
• Flutter version 1.7.8+hotfix.4
• Framework revision 20e59316b8 (4 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.6.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] IntelliJ IDEA Community Edition (version 2019.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 34.0.4
• Dart plugin version 191.6183.88
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0
[✓] Connected device (1 available)
• iPhone Xʀ • D5A5B892-EA4E-4632-8562-D5A55B823E71 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
• No issues found!
In Android Studio, verified that Android Studio->Plugins shows Flutter and Dart plugins are enabled.
In Android Studio, verified that Android Studio->Preferences->Languages & Frameworks shows Flutter and Dart are supported.
After upgrade, exited Android Studio and restarted MAC.
As a work around, I'm creating a new project from the command line, and then editing and running the project from Android Studio.

VS code and Android Studio can't find emulator

Android studio and VS code show me both no devices but flutter doctor shows no issues and the flutter run command runs the app fine
Output in Terminal:
flutter doctor -v
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 3 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/nuggetz/Programme/android/
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/nuggetz/Programme/android/
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
EDIT: when i run in Android Studio Tools > Flutter > flutter doctor I get this output:
/home/nuggetz/Programme/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 4 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Process finished with exit code 0
If the status bar reads No Devices Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed.
The Flutter extension automatically selects the last device connected. However, if you have multiple devices/simulators connected, click device in the status bar to see a pick-list at the top of the screen. Select the device you want to use for running or debugging.
Flutter.dev
just move all sdks from /home/nuggetz/Programme/android/ to /usr/lib/android-sdk

Flutter Finished with error: ProcessException: Permission denied

I want to run my frist app with flutter but I got the following error :
Launching lib/main.dart on Android SDK built for x86 64 in debug mode.
Initializing gradle.
Resolving dependencies.
Finished with error shown below:
ProcessException: Permission denied Command:
/home/abdoul-razak/Android/Sdk/build-tools/28.0.3/aapt dump xmltree
/home/abdoul-razak/Projects/akoybiz/build/app/outputs/apk/app.apk
AndroidManifest.xml
here is the result of flutter doctor:
abdoul-razak#Komche:~/Projects/akoybiz$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
✗ Android license status unknown.
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.30.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
after updating the sdk android here is the result of flutter doctor -v
abdoul-razak#Komche:~/Projects/akoybiz$ flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
• Flutter version 1.0.0 at /home/abdoul-razak/flutter
• Framework revision 5391447fae (il y a 9 semaines), 2018-11-29 19:41:26
-0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /home/abdoul-razak/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/abdoul-razak/Android/Sdk
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.0)
• Android Studio at /opt/android-studio
• Flutter plugin version 23.2.1
• Dart plugin version 171.4424
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[✓] VS Code (version 1.30.2)
• VS Code at /usr/share/code
• Flutter extension version 2.22.2
[✓] Connected device (1 available)
• itel P31 • 45YP8LSO4T7HWCLZ • android-arm • Android 7.0 (API 24)
• No issues found!
The issue is related to your Android SDK licenses. Run the command
flutter doctor --android-licenses
Then press y until it acquires all permissions.
xattr -d com.apple.quarantine ./gradlew
By using this command it solves the issue. I don't know the exact reason but it worked for me.
I stumbled across the same exception. And something fixed it, but I do not know what exactly.
The exception says something different but I think it has something to do where flutter is installed. I reinstalled it again like suggested on their website and it worked...
cd ~/development
tar xf ~/Downloads/flutter_linux_v1.7.8+hotfix.4-stable.tar.xz
Edit: Make sure you use a local folder for your flutter project too.

Resources