有没有人遇到过这个问题:“ERROR获取'android:name'属性:属性不是字符串值”?当我尝试将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 :(得分: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
答案 1 :(得分: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>