I'm having problems creating new flutter projects. The old projects are working fine. I have upgraded flutter to 1.22.5 and Dart SDK to 2.10.4 and activated them. Every time I open Android Studio (after upgrading everything) I get an error message
Plugin Error: Plugin "Flutter App Template Generator" is incompatible (supported only in IntelliJ IDEA).
. My Flutter plugin was upgraded to the latest version 52.0.1.
flutter --no-color create --template app --description A new Flutter application --org uk.co.increate i_am_rich
Steps to Reproduce
Open Android Studio 4.1 and go to File -> New -> New Flutter Project
Fill all the fields and click finish
Another way is to run the command from the terminal inside Android Studio.
Oops; flutter has exited unexpectedly: "FileSystemException: Exists failed, path =
'/root/.pub-cache/hosted/pub.dartlang.org/flutter_template_images-1.0.1/lib/' (OS Error:
Permission denied, errno = 13)".
FileSystemException: Exists failed, OS Error: Permission denied, errno = 13
#0 _Directory.existsSync (dart:io/directory_impl.dart:94:7)
#1 ForwardingFileSystemEntity.existsSync (package:file/src/forwarding/forwarding_file_system_entity.dart:45:33)
#2 ForwardingFileSystemEntity.existsSync (package:file/src/forwarding/forwarding_file_system_entity.dart:45:33)
#3 _templateImageDirectory (package:flutter_tools/src/template.dart:304:79)
<asynchronous suspension>
#4 Template.fromName (package:flutter_tools/src/template.dart:77:38)
#5 CreateCommand._renderTemplate (package:flutter_tools/src/commands/create.dart:791:46)
#6 CreateCommand._generateApp (package:flutter_tools/src/commands/create.dart:671:29)
#7 CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:436:37)
#8 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
#9 _rootRunUnary (dart:async/zone.dart:1198:47)
#10 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#11 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#12 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#13 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#14 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#15 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#16 _rootRun (dart:async/zone.dart:1190:13)
#17 _CustomZone.run (dart:async/zone.dart:1093:19)
#18 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#19 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#20 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#21 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#22 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[✓] Flutter (Channel stable, 1.22.5, on Linux, locale en_US.UTF-8)
• Flutter version 1.22.5 at /home/webdev/flutter
• Framework revision 7891006299 (3 days ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /home/webdev/Android/Sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /usr/lib/jvm/java-8-openjdk-amd64/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
• All Android licenses accepted.
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
[✓] Connected device (1 available)
• 5059D (mobile) • 9DCIBY6SNN6L4DNN • android-arm • Android 8.1.0 (API 27)
! Doctor found issues in 1 category.
Flutter Application Metadata
No pubspec in working directory.
waiting for customer response
The Flutter team cannot make further progress on this issue until the original reporter responds
label
Dec 16, 2020
@jmagman Sorry for the delay, had a busy week.
I was running version 1.20 and did flutter upgrade --force while running with root privileges. Flutter complained to not run it with root, but I ignored the warning and upgraded to 1.22. The directory you are asking for does exist and I have root access to it.
I have just updated the Flutter plugin to 52.1.1 and the error is still there.
EDIT:
I will try a few more things and log everything here.
Running the command without root privileges throws the same error, but with additional info:
Error 1 retrieving device properties for ro.product.cpu.abi:
adb: insufficient permissions for device: missing udev rules? user is in the plugdev group
See [http://developer.android.com/tools/device.html] for more information
Running adb kill-server && adb start-server
outputs
adb server version (41) doesn't match this client (39); killing...
* daemon started successfully
EDIT2:
Running cp -r /home/webdev/Android/Sdk/platform-tools/adb /usr/lib/android-sdk/platform-tools/adb
fixed the problem with adb server version.
I deleted /root/.pub-cache
and /home/webdev/.pub-cache
dirs and ran flutter pub get
again. However, /home/webdev/.pub-cache/hosted/pub.dartlang.org/flutter_template_images-1.0.1
doesn't exits. and I still receive the same error.
PROBLEM SOLVED
After trying few more tricks and nothing, I have decided to reinstall flutter.
1. rm -rf /home/webdev/flutter
2. Installed with manual installation from the docs without root privileges.
3. Run flutter
in terminal, which installed the Dart SDK from Flutter.
4. Ran which flutter dart
/home/webdev/flutter/bin/flutter
/home/webdev/flutter/bin/dart
5. Deleted .pub-cache, .dartServer and .dart
folders from /home/webdev
6. Deleted .flutter, .flutter_tool_state, .dartServer and .dart
from /root/.
7. Ran flutter create
testmyapp from terminal and flutter create new project
from android studio. all working fine.
waiting for customer response
The Flutter team cannot make further progress on this issue until the original reporter responds
label
Dec 19, 2020
I was running version 1.20 and did flutter upgrade --force while running with root privileges. Flutter complained to not run it with root, but I ignored the warning and upgraded to 1.22.
PROBLEM SOLVED
2. Installed with manual installation from the docs without root privileges.
Let's call this an environment issue.