1

当我尝试在 Android 模拟器中运行我的颤振应用程序时,它会引发此异常:

Launching lib/main.dart on sdk gphone x86 in debug mode...
lib/main.dart:1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/divyesh12/Documents/Development /GitRepos/Shopapp_flutter/myshop_app/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:23: AAPT: error: unexpected element <uses-permission> found in <manifest><application>.

扑医生结果:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.57.1)
[✓] Connected device (2 available)
• No issues found!

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myste_app">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

注意:它在iOS中运行良好,如何解决这个问题?

4

1 回答 1

0

您可能在错误的 xml 文件中添加了权限。

您应该在此路径中编辑 xml 文件以添加权限:

\android\app\src\main\AndroidManifest.xml
于 2021-06-20T17:06:12.890 回答