2014-01-09 460 views
0

有沒有人遇到過這個問題:「ERROR getting'android:name'屬性:屬性不是字符串值」?當我試圖上傳一個apk到谷歌播放時,我知道了,我不知道我的apk中有什麼問題,導致它完美地工作。這是一個錯誤嗎?嘗試上傳apk到谷歌播放時出現錯誤

這裏是我的清單文件

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="app.com.discountscatcher" 
android:versionCode="1" 
android:versionName="1.0" > 

<uses-sdk 
    android:maxSdkVersion="19" 
    android:minSdkVersion="8" 
    android:targetSdkVersion="18" /> 

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.VIBRATE" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 

<application 
    android:allowBackup="true" 
    android:debuggable="false" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:logo="@drawable/ic_actionbar_title" 
    android:theme="@style/AppTheme" > 
    <receiver 
     android:name="com.discountscatcher.util.NotifyDeleteReceiver" 
     android:exported="false" > 
     <intent-filter> 
      <action android:name="@string/intent_filter_deleteintent" /> 
     </intent-filter> 
    </receiver> 

    <activity 
     android:name="com.discountscatcher.main.MainActivity" 
     android:configChanges="orientation" 
     android:launchMode="singleTop" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name="com.discountscatcher.main.PromoListActivity" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 

    <service 
     android:name="com.discountscatcher.util.PointService" > 
    </service> 

    <activity 
     android:name="com.discountscatcher.main.AboutActivity" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 
    <activity 
     android:name="com.discountscatcher.main.PromoActivityDetails" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 
    <activity android:name="com.discountscatcher.util.TEST_SERVICE_EMULATING" > 
    </activity> 
    <activity 
     android:name="com.discountscatcher.main.FullScreenImageActivity" 
     android:screenOrientation="portrait" > 
    </activity> 

    <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="3265130" /> 

    <activity android:name="com.discountscatcher.main.DiscountsCatcherActivity" > 
    </activity> 

    <receiver android:name="com.discountscatcher.util.RebootReceiver" > 
     <intent-filter> 
      <action android:name="android.intent.action.BOOT_COMPLETED" /> 
     </intent-filter> 
    </receiver> 
</application> 

+0

我的東西有一個問題在xml中,特別是在值文件夾。所以檢查那裏。 –

+0

請在manifees處和活動 –

+0

處尋找您的包。您需要將應用程序名稱作爲字符串放在string.xml文件中,該文件位於res - > values - > string.xml中 –

回答

1

定義package="app.com.discountscatcher"

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="app.com.discountscatcher" // Your application Package 
android:versionCode="1" 
android:versionName="1.0" > 

但是,你正在使用com.discountscatcher.main.MainActivity

<activity 
     android:name="com.discountscatcher.main.MainActivity" // Different Package name 
     android:configChanges="orientation" 
     android:launchMode="singleTop" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

嘗試將其更改爲"app.com.discountscatcher"

就像在你的包名app.com.discountscatcher.MainActivity

+0

Thx man,但爲什麼它不會當我啓動一個應用程序並使用它時不會拋出任何錯誤? – whizzzkey

+0

@whizzzkey AndroidManifest.xml中標識的包名稱是應用程序的唯一標識符。所以需要遵循這些對策。 –

0

問題。請做到這一點,我糾正了這一點。請確認您的包名稱兩次。程序包名稱需要始終與應用程序中的每個位置相同。

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="app.com.discountscatcher" 
android:versionCode="1" 
android:versionName="1.0" > 

<uses-sdk 
    android:maxSdkVersion="19" 
    android:minSdkVersion="8" 
    android:targetSdkVersion="18" /> 

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.VIBRATE" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 

<application 
    android:allowBackup="true" 
    android:debuggable="false" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:logo="@drawable/ic_actionbar_title" 
    android:theme="@style/AppTheme" > 
    <receiver 
     android:name=".util.NotifyDeleteReceiver" 
     android:exported="false" > 
     <intent-filter> 
      <action android:name="@string/intent_filter_deleteintent" /> 
     </intent-filter> 
    </receiver> 

    <activity 
     android:name=".main.MainActivity" 
     android:configChanges="orientation" 
     android:launchMode="singleTop" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".main.PromoListActivity" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 

    <service 
     android:name=".util.PointService" > 
    </service> 

    <activity 
     android:name=".main.AboutActivity" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 
    <activity 
     android:name=".main.PromoActivityDetails" 
     android:configChanges="orientation" 
     android:screenOrientation="portrait" > 
    </activity> 
    <activity android:name=".util.TEST_SERVICE_EMULATING" > 
    </activity> 
    <activity 
     android:name=".main.FullScreenImageActivity" 
     android:screenOrientation="portrait" > 
    </activity> 

    <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="3265130" /> 

    <activity android:name=".main.DiscountsCatcherActivity" > 
    </activity> 

    <receiver android:name=".util.RebootReceiver" > 
     <intent-filter> 
      <action android:name="android.intent.action.BOOT_COMPLETED" /> 
     </intent-filter> 
    </receiver> 
</application> 
相關問題