2016-07-27 185 views
0

安裝應用程序時出現奇怪的問題。如果我在Android 5.0以上版本上安裝應用程序,那麼應用程序正在安裝並正常工作。但是,如果我在4.4或4.2的低版本上安裝應用程序,那麼它在安裝時給我這個錯誤。 Getting error while installing app安裝失敗並顯示消息INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

大量的RND後,我得到,如果你的包名稱包含大寫字母,那麼你會得到這種類型的錯誤,但在我的包名稱中沒有上限字母。下面是我的清單文件代碼:-` 包= 「com.aznimo」>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
<uses-permission android:name="android.permission.WAKE_LOCK" /> 
<uses-permission android:name="android.permission.VIBRATE" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 
//////////////// 
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 

<permission 
    android:name="com.example.gcm.permission.C2D_MESSAGE" 
    android:protectionLevel="signature" /> 

<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" /> 

<application 
    android:name="Comman.MyApplication" 
    android:allowBackup="true" 
    android:hardwareAccelerated="true" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <meta-data 
     android:name="com.facebook.sdk.ApplicationId" 
     android:value="@string/app_id" /> 

    <activity 
     android:name=".Splash_Screen" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".Login_Screen" 
     android:label="@string/title_activity_login__screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden|adjustResize" /> 
    <activity 
     android:name=".Signup_Screen" 
     android:label="@string/title_activity_signup__screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden|adjustResize" /> 
    <activity 
     android:name=".Forgot_Password" 
     android:label="@string/title_activity_forgot__password" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden|adjustResize" /> 
    <activity 
     android:name="com.facebook.FacebookActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.Translucent.NoTitleBar" /> 

    <provider 
     android:name="com.facebook.FacebookContentProvider" 
     android:authorities="com.facebook.app.FacebookContentProvider922739857843448" 
     android:exported="true" /> 

    <activity 
     android:name=".Privacy_Policy_Screen" 
     android:label="@string/title_activity_privacy__policy__screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Home_Screen" 
     android:label="@string/title_activity_home__screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Product_View_All" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Category_List_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Product_detail" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".GalleryActivity" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".You_Tube_Screen" 
     android:screenOrientation="landscape" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Profile_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Edit_Profile_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden|adjustResize"> 
     <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:host="t4jsample" 
       android:scheme="oauth" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".New_Address_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden|adjustResize" /> 
    <activity 
     android:name=".Twitter_Webview_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Address_List_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Order_List_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Order_Detail_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Search_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateAlwaysVisible" /> 
    <activity 
     android:name=".Cart_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Delivery_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Payment_Confirmation_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".Payment_Method_Screen" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    <activity 
     android:name=".New_Address_Screen_Map" 
     android:screenOrientation="portrait" 
     android:theme="@style/AppTheme" 
     android:windowSoftInputMode="stateHidden" /> 
    ///////////// 
    <receiver 
     android:name="com.google.android.gms.gcm.GcmReceiver" 
     android:exported="true" 
     android:permission="com.google.android.c2dm.permission.SEND"> 
     <intent-filter> 
      <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 

      <category android:name="com.aznimo" /> 
     </intent-filter> 
    </receiver> 

    <service 
     android:name=".PushNotificationService" 
     android:exported="false"> 
     <intent-filter> 
      <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
     </intent-filter> 
    </service> 
    <!-- 
     Optionally, register AnalyticsReceiver and AnalyticsService to support background 
     dispatching on non-Google Play devices 
    --> 
    <receiver 
     android:name="com.google.android.gms.analytics.AnalyticsReceiver" 
     android:enabled="true"> 
     <intent-filter> 
      <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" /> 
     </intent-filter> 
    </receiver> 

    <service 
     android:name="com.google.android.gms.analytics.AnalyticsService" 
     android:enabled="true" 
     android:exported="false" /> 

    <!-- 
     Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable 
     installation campaign reporting 
    --> 
    <receiver 
     android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" 
     android:exported="true"> 
     <intent-filter> 
      <action android:name="com.android.vending.INSTALL_REFERRER" /> 
     </intent-filter> 
    </receiver> 

    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" /> 

    <!-- 
     The API key for Google Maps-based APIs is defined as a string resource. 
     (See the file "res/values/google_maps_api.xml"). 
     Note that the API key is linked to the encryption key used to sign the APK. 
     You need a different API key for each encryption key, including the release key that is used to 
     sign the APK for publishing. 
     You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    --> 
    <meta-data 
     android:name="com.google.android.geo.API_KEY" 
     android:value="@string/google_maps_key" /> 


</application> 

`

我不是即使在logcat中部分得到任何錯誤。任何機構能告訴我最新的問題或者我做錯了什麼。提前致謝。

+1

您是否嘗試按「確定」? – Danieboy

+0

您的清單標記僅在上述代碼中丟失(不在實際文件中),對嗎?此外,如果在Studio壓縮Atl + Ctrl + L重新格式化代碼,應該有助於可讀性。 – Shaishav

回答

1

至少這會導致「明顯惡意」的錯誤:

<application 
    android:name="Comman.MyApplication" 

如果應用程序類名稱中包含.,它被視爲一個完全合格的包名。軟件包部分必須以小寫字母開頭,格式爲az,並且您的首字母大寫爲C

請參閱PackageParser source瞭解安裝可能會因「顯示格式錯誤」而失敗的各種方式。在這種情況下,null在解析application元素時從buildClassName()返回。

+0

感謝解決方案親愛的現在工作。 –

相關問題