安装解析失败的明显畸形:失败的解析

发布于 2025-02-03 11:14:20 字数 4872 浏览 2 评论 0 原文

我是Flutter&我正在尝试在VS代码上运行现有应用程序。当我尝试在Android模拟器上运行它时,我会在终端上收到此错误消息:

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install
/Users/tazar/Downloads/ethereal-meditations-app-made-app-runnable/build/app/outputs/flutter-apk/app
.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI:
/data/app/vmdl469477611.tmp/base.apk (at Binary XML file line #260):
com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver: 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 arm64.

这是我的AndroidManifest.xml文件:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="path">
   <application
        android:label="---"
        android:icon="@mipmap/ic_launcher">

        <!-- FACEBOOK LOGIN -->
        <meta-data android:name="com.facebook.sdk.ApplicationId"
              android:exported="true"
              android:value="@string/facebook_app_id"/>
          <activity android:name="com.facebook.FacebookActivity"
              android:configChanges=
                      "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
              android:exported="true"
              android:label="@string/app_name" />
          <activity
              android:name="com.facebook.CustomTabActivity"
              android:exported="true">
              <intent-filter>
                  <action android:name="android.intent.action.VIEW" />
                  <category android:name="android.intent.category.DEFAULT" />
                  <category android:name="android.intent.category.BROWSABLE" />
                  <data android:scheme="@string/fb_login_protocol_scheme" />
              </intent-filter>
          </activity>
        <!-- END FACEBOOK LOGIN -->
        
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <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>
        <!-- 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" />
            

        <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
        <!-- EM account: android:value="ca-app-pub-3706741424467059~5052028195"/> -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3706741424467059~5052028195"/>

            <!-- android:value="ca-app-pub-8622122832922913~9459724912"/> -->
            <!-- android:value="ca-app-pub-3940256099942544~3347511713"/> -->


    </application>
    <uses-permission android:name="android.permission.INTERNET"/>


</manifest>

该应用程序在浏览器上运行良好,但在模拟器上不行。当我试图解决这个问题时,我所看的任何地方都被告知要在每个活动中添加“ android:enfored ='true'”。我进行了这些更改,但仍然遇到同样的错误。我现在有点卡住了&amp;我不知道该怎么办。请随时分享您的想法,我真的很感激。

I am new to Flutter & I am trying to run an existing app on VS Code. I get this error message on my terminal when I attempt to run it on the Android emulator:

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install
/Users/tazar/Downloads/ethereal-meditations-app-made-app-runnable/build/app/outputs/flutter-apk/app
.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI:
/data/app/vmdl469477611.tmp/base.apk (at Binary XML file line #260):
com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver: 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 arm64.

This is my AndroidManifest.xml file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="path">
   <application
        android:label="---"
        android:icon="@mipmap/ic_launcher">

        <!-- FACEBOOK LOGIN -->
        <meta-data android:name="com.facebook.sdk.ApplicationId"
              android:exported="true"
              android:value="@string/facebook_app_id"/>
          <activity android:name="com.facebook.FacebookActivity"
              android:configChanges=
                      "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
              android:exported="true"
              android:label="@string/app_name" />
          <activity
              android:name="com.facebook.CustomTabActivity"
              android:exported="true">
              <intent-filter>
                  <action android:name="android.intent.action.VIEW" />
                  <category android:name="android.intent.category.DEFAULT" />
                  <category android:name="android.intent.category.BROWSABLE" />
                  <data android:scheme="@string/fb_login_protocol_scheme" />
              </intent-filter>
          </activity>
        <!-- END FACEBOOK LOGIN -->
        
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <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>
        <!-- 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" />
            

        <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
        <!-- EM account: android:value="ca-app-pub-3706741424467059~5052028195"/> -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3706741424467059~5052028195"/>

            <!-- android:value="ca-app-pub-8622122832922913~9459724912"/> -->
            <!-- android:value="ca-app-pub-3940256099942544~3347511713"/> -->


    </application>
    <uses-permission android:name="android.permission.INTERNET"/>


</manifest>

The app runs fine on the browser, but not on the emulator. When I attempted to solve this issue, everywhere I looked, I was told to add "android:exported='true'" to each activity. I made those changes, but I still get the same error. I am kinda stuck now & I don't know what to do. Please feel free to share your thoughts, I would really appreciate it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟─花易冷 2025-02-10 11:14:20

您必须遵循这些规则才能从Targetsdk 30到31

据我所知,您的清单缺少这一点

意图过滤器:如果您的应用程序包含活动,服务或
使用意图过滤器的广播接收器,您必须明确
声明这些组件的Android:导出属性。

you have to follow these rules to migrate from targetSdk 30 to 31
https://developer.android.com/google/play/requirements/target-sdk#pre12

As far as I see it your manifest is missing this point

Intent filters: If your app contains activities, services, or
broadcast receivers that use intent filters, you must explicitly
declare the android:exported attribute for these components.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文