发生%1的安装错误,颤振不是有效的Win32应用程序 [英] Flutter with installation error for %1 is not a valid win32 application
问题描述
我是新手,请尝试按照以下步骤安装它... 1)下载并解压缩到驱动器中 2)在环境变量中设置路径
I am new in the flutter and trying to install it with following steps... 1) download and unzipped in drive 2) Set path in environment variables
现在我正在尝试运行Flutter Doctor,它向我显示以下错误,请检查是否有人遇到相同的问题...谢谢!
Now i am trying to run flutter doctor it's showing me below error please check if anyone face same issue...Thanks!
` [√] Flutter (Channel beta, v0.6.0, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
-Unhandled exception:
ProcessException: %1 is not a valid Win32 application.
Command: C:\Users\Rahul Mishra\AppData\Local\Android\Sdk\platform-tools\adb.EXE devices -l
#0 _ProcessImpl._runAndWait (dart:io/runtime/binprocess_patch.dart:488:7)
#1 _runNonInteractiveProcessSync (dart:io/runtime/binprocess_patch.dart:634:18)
#2 Process.runSync (dart:io/runtime/binprocess_patch.dart:66:12)
#3 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83:20)
#4 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:322:48)
#5 runSync (package:flutter_tools/src/base/process.dart:296:10)
#6 getAdbDevices (package:flutter_tools/src/android/android_device.dart:563:23)
#7 AndroidDevices.pollingGetDevices (package:flutter_tools/src/android/android_device.dart:55:53)
<asynchronous suspension>
#8 PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:163:56)
<asynchronous suspension>
#9 DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:91:46)
<asynchronous suspension>
#10 DeviceValidator.validate (package:flutter_tools/src/doctor.dart:537:54)
<asynchronous suspension>
#11 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:88:56)
#12 Doctor.diagnose (package:flutter_tools/src/doctor.dart:145:41)
#13 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#14 Doctor.diagnose (package:flutter_tools/src/doctor.dart:135:24)
#15 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
#16 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#17 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:28:42)
#18 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:348:18)
#19 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#20 _rootRunUnary (dart:async/zone.dart:1132:38)
#21 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#23 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#24 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#25 Future._complete (dart:async/future_impl.dart:476:7)
#26 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#27 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#28 _rootRun (dart:async/zone.dart:1124:13)
#29 _CustomZone.run (dart:async/zone.dart:1021:19)
#30 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#31 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#33 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:114:13)
#34 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:170:5)`
推荐答案
当我遇到这个问题时,是因为环境变量ANDROID_HOME中有一个空格,在您的情况下,它将是C:\ Users \ Rahul Mishra \ AppData \ Local \ Android \ Sdk,Rahul和Mishra之间有一个空格
When I ran into this it was because the environment variable ANDROID_HOME had a space in it, in your case it would be C:\Users\Rahul Mishra\AppData\Local\Android\Sdk and there is a space between Rahul and Mishra
解决该问题的方法是,将我的个人资料连接到不包含空格的地方,然后将ANDROID_HOME重定向到该个人资料.要建立路口,您可以执行以下操作:
What I did to resolve it is make a junction to my profile that doesn't contain spaces and redirect ANDROID_HOME to it. To make a junction you would do something like:
mklink /J C:\Users\rmishra "C:\Users\Rahul Mishra"
然后在系统属性"->环境变量"中将ANDROID_HOME更改为指向C:\ Users \ rmishra \ AppData \ Local \ Android \ Sdk
Then in System Properties -> Environment Variables change ANDROID_HOME to point to C:\Users\rmishra\AppData\Local\Android\Sdk
希望这会有所帮助
这篇关于发生%1的安装错误,颤振不是有效的Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!