【问题标题】:FLUTTER ERROR :Error: ADB exited with exit code 1FLUTTER ERROR :Error: ADB exited with exit code 1
【发布时间】:2022-01-21 08:03:45
【问题描述】:

我在运行我的 Flutter 应用程序时遇到此错误。该应用程序在 chrome 上启动,但不会在模拟器或真正的移动设备上启动

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install 
C:\Users\HP\Desktop\OWASLO\care_giver_app\build\app\outputs\flutter-apk\app.apk: 
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during 
installPackageLI: /data/app/vmdl1352177004.tmp/base.apk (at Binary XML file line #53): 
com.owaslo.sukithasagayo.caregiver.MainActivity: Targeting S+ (version 31 and above) 
requires that an explicit value for android:exported be defined when intent filters 
are present]
Error launching application on Pixel 6.

下面是我的 AndroidManifest 文件。我在 gradle 文件中也启用了 multidex。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.owaslo.sukithasagayo.caregiver">
 <uses-permission android:name="android.permission.INTERNET"/>
  <application
    android:label="Sukitha Sagayo Member"
    android:icon="@mipmap/launcher_icon">
   <provider
       android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
       android:authorities="${applicationId}.flutter_downloader.provider"
       android:exported="false"
       android:grantUriPermissions="true">
       <meta-data
           android:name="android.support.FILE_PROVIDER_PATHS"
           android:resource="@xml/provider_paths"/>
   </provider>

   <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
       
        <meta-data
          android:name="io.flutter.embedding.android.NormalTheme"
          android:resource="@style/NormalTheme"
          />
       
        <meta-data
          android:name="io.flutter.embedding.android.SplashScreenDrawable"
          android:resource="@drawable/launch_background"
          />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />
</application>

下面的链接包含我的 gradle 文件 gradle file

请帮忙!!!

【问题讨论】:

    标签: flutter dart gradle exception build


    【解决方案1】:

    将此属性添加到&lt;activity&gt;,从android 12开始,它需要为活动编写此属性,并且您的设备具有android api级别31,即android - 12

    android:exported="true"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-02
      • 1970-01-01
      • 1970-01-01
      • 2022-08-16
      • 1970-01-01
      • 2022-12-28
      相关资源
      最近更新 更多