gradle Flutter错误:错误:ADB已退出,退出代码为1

fhity93d  于 2022-11-14  发布在  Flutter
关注(0)|答案(3)|浏览(134)

我在运行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
请帮帮忙!!!

brccelvz

brccelvz1#

将此属性从android 12添加到<activity>,需要为活动编写此属性,并且您的设备具有android api级别31,即android - 12

android:exported="true"
6ss1mwsb

6ss1mwsb2#

不仅启用“USB调试”,还启用“通过USB安装”(小米)。

lymgl2op

lymgl2op3#

我所做的是我把local.properties中的minSdkversion改为29,因为我的设备是android 10设备,所以根据你的android版本编辑该行,它应该可以工作。

相关问题