2015-03-30 61 views
0

我只想爲mygame添加橫幅,但是當我構建我的遊戲時,我面對統一控制檯中的此錯誤。AndroidManifest「app_banner」問題

AndroidManifest.xml:4:錯誤:錯誤:找不到與給定名稱匹配的資源(在'banner'處,值爲'@ drawable/app_banner')。

你可以找到我的AndroidManifest.xml文件,

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity.package" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal"> 
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /> 
    <application android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner"> 
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> 
     </intent-filter> 
     <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> 
     <!-- 

     The unityplayer.ForwardNativeEventsToDalvik flag is the only difference 
     from Unity's auto-generated default AndroidManifest.xml. We require this 
     flag to be true for ads to be clickable. 

     If you are using another plugin that also ships with an 
     Assets/Plugins/AndroidManifest.xml, you can use their copy after setting 
     this flag to true. 

     --> 
     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> 
    </activity> 
    </application> 
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" /> 
    <uses-feature android:glEsVersion="0x00020000" /> 
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> 
    <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" /> 
    <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" /> 
</manifest> 
+0

什麼文件在你的res/drawable文件夾中? – 2015-03-30 20:32:12

+0

只有4個文件@FredGrott; common_signin_btn_icon_dark; common_signin_btn_icon_light; common_signin_btn_text_dark; common_signin_btn_text_light; – 2015-03-30 20:35:27

回答

0

@ugur錯誤告訴你什麼是失蹤它不是在你提供的文件列表,因此你必須把該文件中的文件夾繪製刪除你加他條幅error..once繪製錯誤就會消失

0

沒有在這個環節上過類似的問題,但是這並沒有爲我工作: http://answers.unity3d.com/questions/935508/failed-to-re-package-resources-unity-5.html?sort=oldest

對我來說改變AndroidManifest.xml中有日訣竅如下:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.example.admobtest" android:versionName="1.0" android:versionCode="1"> 
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /> 
    <!-- Google Mobile Ads Permissions --> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <application android:icon="@drawable/app_icon" android:label="@string/app_name"> 
    <!-- meta-data tag for Google Play services --> 
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> 
    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" > 
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> 
    </activity> 
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" > 
    </activity> 
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" > 
     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <meta-data android:name="android.app.lib_name" android:value="unity" /> 
    </activity> 
    <activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" > 
    </activity> 
    </application> 
    <uses-feature android:glEsVersion="0x00020000" /> 
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" /> 
</manifest> 
0

我有banner.png在正確的地方,其餘的東西也沒問題。 當我通過「SDK管理器」更新sdk到最新狀態時,它可以工作