如何修复“ ro.product.cpu.abi的错误检索设备属性:” Android Studio-Flutter

时间:2019-06-10 05:54:25

标签: flutter

当我第一次在Flutter官方网站上的文档帮助下安装flutter时。并且还将Android studio设置为IDE,以免产生混乱。之后,引导用户创建一个新的flutter项目,并在应用程序的样板代码上的仿真器/实际设备上运行,以计算用户按下按钮的次数。但是它每次都抛出未处理的异常。

我尝试在仿真器上运行,但也实际运行,但所有都仅抛出错误。如果有人对扑动有所了解,请帮助我,因为我是扑扑环境的新手。请参阅代码以获取更多信息。

//**********************main.dart**************************
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

/// same as boilerplate code in any flutter new app
///My Flutter Version - *****************************************
Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (6 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.765], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[!] VS Code (version 1.34.0)
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] VS Code, 64-bit edition (version 1.26.1)
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
Error retrieving device properties for ro.product.cpu.abi:

[√] Connected device (2 available)

! Doctor found issues in 2 categories.
Error retrieving device properties for ro.product.cpu.abi:


// Error on run app
Error retrieving device properties for ro.product.cpu.abi:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
--------- beginning of main
06-10 10:49:33.781 D/VvmStatusSmsFetcher( 1919): Request SMS successfully sent
Unhandled exception:
Exit code -1073740940 from: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
#0      _runWithLoggingSync (package:flutter_tools/src/base/process.dart:360:7)
#1      runCheckedSync (package:flutter_tools/src/base/process.dart:289:10)
#2      AndroidDevice.lastLogcatTimestamp (package:flutter_tools/src/android/android_device.dart:513:27)
#3      _AdbLogReader._start (package:flutter_tools/src/android/android_device.dart:688:41)
#4      _runGuarded (dart:async/stream_controller.dart:805:24)
#5      _BroadcastStreamController._subscribe (dart:async/broadcast_stream_controller.dart:213:7)
#6      _ControllerStream._createSubscription (dart:async/stream_controller.dart:818:19)
#7      _StreamImpl.listen (dart:async/stream_impl.dart:472:9)
#8      FlutterDevice.startEchoingDeviceLog (package:flutter_tools/src/resident_runner.dart:318:71)
#9      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:361:5)
<asynchronous suspension>
#10     HotRunner.run (package:flutter_tools/src/run_hot.dart:253:39)
<asynchronous suspension>
#11     AppDomain.startApp.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:389:23)
#12     AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:449:26)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#14     _rootRun (dart:async/zone.dart:1124:13)
#15     _CustomZone.run (dart:async/zone.dart:1021:19)
#16     _runZoned (dart:async/zone.dart:1516:10)
#17     runZoned (dart:async/zone.dart:1463:12)
#18     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#19     AppInstance._runInZone (package:flutter_tools/src/commands/daemon.dart:819:20)
#20     AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:447:15)
<asynchronous suspension>
#21     AppDomain.startApp (package:flutter_tools/src/commands/daemon.dart:383:12)
<asynchronous suspension>
#22     RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:301:38)
<asynchronous suspension>
#23     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:559:18)
#24     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#25     _rootRunUnary (dart:async/zone.dart:1132:38)
#26     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#27     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#28     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#29     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#30     Future._complete (dart:async/future_impl.dart:473:7)
#31     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#32     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
#33     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
#34     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#35     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#36     _rootRunUnary (dart:async/zone.dart:1132:38)
#37     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#38     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#39     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#40     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#41     Future._complete (dart:async/future_impl.dart:473:7)
#42     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#43     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
#44     _rootRun (dart:async/zone.dart:1124:13)
#45     _CustomZone.run (dart:async/zone.dart:1021:19)
#46     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#49     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#50     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

1 个答案:

答案 0 :(得分:3)

  
    
      

检索ro.product.cpu.abi的设备属性时出错:

    
  

此问题与Android Studio的新更新(29)

目前有一个临时修复程序(如果您使用的是Windows)!

1。。关闭Android Studio

2。。打开CMD并输入:taskkill /f /im adb.exe

3。。下载此文件:http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-windows.zip

4。转到

  

C:\ Users [您的用户名] \ AppData \ Local \ Android \ Sdk

并将“ platform-tools”文件夹替换为您刚刚下载的新文件夹。

ps:(a)不要忘记保留备份(b)AppData是隐藏文件夹(一开始可能看不到)