Android应用安装失败INSTALL_PARSE_FAILED_MANIFEST_MALFORMED问题求助
Hey there, I can spot exactly what’s causing that annoying installation failure! The error message points straight to a missing attribute in your AndroidManifest.xml file.
What’s the Root Issue?
Looking at your manifest code, the <meta-data> tag for the Facebook SDK Application ID is incomplete:
<meta-data android:name="com.facebook.sdk.ApplicationId" />
Android requires every <meta-data> element to have either an android:value or android:resource attribute—yours has neither, which is why the parser throws that error at line 34.
How to Fix It
You’ve got two simple, valid options here:
Hardcode your Facebook App ID directly (not ideal for production)
Add theandroid:valueattribute with your actual App ID:<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="YOUR_FACEBOOK_APP_ID_HERE" />Use a string resource (best practice)
First, add your App ID to yourstrings.xmlfile:<string name="facebook_app_id">YOUR_FACEBOOK_APP_ID_HERE</string>Then update the meta-data tag to reference this resource:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:resource="@string/facebook_app_id" />(Note: You can also use
android:value="@string/facebook_app_id"here—both work, but usingresourcealigns better with Android’s standard reference patterns.)
Quick Note on Uninstalling & Reinstalling
While uninstalling the existing app and reinstalling might clear minor cache issues, it won’t fix the core problem here. Once you fix the meta-data tag in your manifest, the installation should work smoothly without needing that step (though it doesn’t hurt to try if you run into tiny hiccups afterward).
Corrected Manifest for Reference
Here’s your full manifest with the fix applied (using the string resource approach):
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hfad.imdblogin"> <uses-permission android:name="android.permission.INTERNET" /> <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/AppTheme"> <activity android:name=".activities.ActivityLoginPage" /> <activity android:name=".activities.ActivitySignUp" /> <meta-data android:name="com.facebook.sdk.ApplicationId" android:resource="@string/facebook_app_id" /> <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" /> <activity android:name=".activities.ActivityHomepage"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".activities.CreateAccountActivity" /> <activity android:name=".activities.AnimeActivity" /> <activity android:name=".activities.NotificationActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
Just replace YOUR_FACEBOOK_APP_ID_HERE with your actual Facebook App ID, and you should be all set!
内容的提问来源于stack exchange,提问作者Farhad Ba-ali

