首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >颤振: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: installPackageLI期间的失败解析

颤振: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: installPackageLI期间的失败解析
EN

Stack Overflow用户
提问于 2022-05-08 17:08:37
回答 4查看 5.6K关注 0票数 6

我的颤栗应用程序没有安装在Android 12版本上。我试过用android:exported,但没有用。它给我看了这种错误-

代码语言:javascript
运行
复制
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...                 3.3s
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install /Users/abir/Documents/Office
Work/MediMate-App-Old-Version/build/app/outputs/flutter-apk/app.apk: Failure
[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI:
/data/app/vmdl489268217.tmp/base.apk (at Binary XML file line #125):
io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: 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 sdk gphone64 x86 64.

这是我的AndroidManifest.xml文件

代码语言:javascript
运行
复制
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="care.example.health">
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.-->
    <uses-permission android:name="android.permission.BLUETOOTH" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <application
        android:label="example"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:exported="true"
            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">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter 
                android:exported="false">
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter 
                android:exported="false">
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
       
    </application>
</manifest>

我错过了什么?

EN

回答 4

Stack Overflow用户

发布于 2022-08-29 13:54:08

如果您在android工作室仿真器上运行您的颤振应用程序时收到此错误消息,这将为我解决这个问题!

代码语言:javascript
运行
复制
 Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install C:\Users\aasmu\OneDrive\Proskjekt\Flutter_course\flash-chat-flutter\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl2080833837.tmp/base.apk (at Binary XML file line #28): co.appbrewery.flash_chat.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

1.定位您的androidManifest.xml

在android的右侧,您的项目文件遵循以下路径:

你的项目name'/android/app/src/main/AndroidManifest.xml

用黄色高架显示android演播室文件路径的图像

2.在AndroidManifest.xml文件中,找到这组代码:

代码语言:javascript
运行
复制
<activity
   android:name=".MainActivity"
   android:launchMode="singleTop"
   android:theme="@style/LaunchTheme"        
   android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
   android:hardwareAccelerated="true"
   android:windowSoftInputMode="adjustResize">
   <intent-filter>
     <action android:name="android.intent.action.MAIN"/>
     <category android:name="android.intent.category.LAUNCHER"/>
   </intent-filter>
</activity>

显示两条垂直红线之间的部分的图像

3.复制并粘贴这一行,介于“”之间.

Android:exported=“真”Image showing the line pasted in between the yellow'

你的问题现在应该解决了!

如果您的问题仍然存在,

票数 7
EN

Stack Overflow用户

发布于 2022-06-09 11:46:25

就连我也面临着同样的问题。我能够克服它,直接在插件中为特定服务添加下面的代码。

代码语言:javascript
运行
复制
android:exported="true"

您可以在下面的路径中找到插件代码

代码语言:javascript
运行
复制
your_flutter_sdk_location/.pub-cache/hosted/pub.dartlang.org/package_name
票数 3
EN

Stack Overflow用户

发布于 2022-05-08 18:08:15

根据你的问题,你的问题是FlutterFirebaseMessagingService的到来。如果您在日志中看到,已经提到了

代码语言:javascript
运行
复制
io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: Targeting S+ (version 31 and above)
requires that an explicit value for android:exported be defined when intent filters are present]

您只需从意图过滤器中删除额外的android:exported="false“。放在这里就像

代码语言:javascript
运行
复制
            <intent-filter >
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

如果没有更新插件,也要更新插件。

  • firebase_core:^1.16.0
  • firebase_messaging:^11.3.0
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72163375

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档