当我将手机更新到 Android 12 时,安装失败。无法安装应用程序:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

发布于 2025-01-12 01:56:41 字数 4449 浏览 0 评论 0原文

自从我将手机更新到 Android 12 以来,我一直在完美地处理我的项目,不幸的是,当我在手机上运行该项目时,会出现此错误:

安装失败。 无法安装应用程序:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

apk 列表: [0] 'C:\Users\Microsoft\AndroidStudioProjects\YmmyServer\app\build\outputs\apk\debug\app-debug.apk' 安装失败,原因是:“null” 重试

这是我的 build.gradle(Project) 文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.android.tools.build:gradle:4.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的 build.gradle(Module) 文件:

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 32
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.ymmyserver"
        minSdkVersion 30
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {

    implementation 'com.github.jd-alexander:android-flat-button:v1.1'
//    implementation 'info.hoang8f:fbutton:1.0.5'
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-storage'
    implementation 'com.firebaseui:firebase-ui-database:8.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation "androidx.cardview:cardview:1.0.0"
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.google.firebase:firebase-core:10.2.0'
    implementation 'com.google.firebase:firebase-database'
    implementation 'com.google.firebase:firebase-analytics'
    implementation platform('com.google.firebase:firebase-bom:29.1.0')
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.4.1'
    implementation 'androidx.navigation:navigation-ui:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

这是 Mainifest 文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ymmyserver">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Ymmy">
        <activity android:name=".FoodList"></activity>
        <activity
            android:name=".Home"
            android:label="@string/title_activity_home"
            android:theme="@style/Theme.Ymmy.NoActionBar"></activity>
        <activity android:name=".SignIn" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我应该做什么,请帮助我

I was working on my project perfectly since I Update my phone to Android 12 unfortunately when I run the project to my phone this Error appears:

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

List of apks:
[0] 'C:\Users\Microsoft\AndroidStudioProjects\YmmyServer\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: 'null'
Retry

This is My build.gradle(Project) File:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.android.tools.build:gradle:4.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

And this is My build.gradle(Module) File:

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 32
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.ymmyserver"
        minSdkVersion 30
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {

    implementation 'com.github.jd-alexander:android-flat-button:v1.1'
//    implementation 'info.hoang8f:fbutton:1.0.5'
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-storage'
    implementation 'com.firebaseui:firebase-ui-database:8.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation "androidx.cardview:cardview:1.0.0"
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.google.firebase:firebase-core:10.2.0'
    implementation 'com.google.firebase:firebase-database'
    implementation 'com.google.firebase:firebase-analytics'
    implementation platform('com.google.firebase:firebase-bom:29.1.0')
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.4.1'
    implementation 'androidx.navigation:navigation-ui:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

And this is the Mainifest File:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ymmyserver">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Ymmy">
        <activity android:name=".FoodList"></activity>
        <activity
            android:name=".Home"
            android:label="@string/title_activity_home"
            android:theme="@style/Theme.Ymmy.NoActionBar"></activity>
        <activity android:name=".SignIn" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

What Should I do Please Help Me

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

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

发布评论

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

评论(2

暮年 2025-01-19 01:56:41

尝试在 Activity 的 AndroidManifest.xml 文件中使用此标记

<activity 
   android:name=".MainActivity"
   android:exported="true">

Try to use this tag in your AndroidManifest.xml file for the activity

<activity 
   android:name=".MainActivity"
   android:exported="true">
风筝有风,海豚有海 2025-01-19 01:56:41

通过在 Mainifest 文件中的主 Activity 上添加 android:exported="true" 来解决:

<activity android:name=".MainActivity"
        android:exported="true">

Solved by Adding android:exported="true" on the main Activity in Mainifest File:

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