Android resource linking failed when i deployment

2019-08-23 19:14发布

问题:

I get this error when I select my android device. I'm using it for game testing with libgdx.

Android resource linking failed

C:\Users\oguzh\AndroidStudioProjects\Flying Smurfs\android\build\intermediates\ınstant_run_merged_manıfests\debug\processDebugManifest\instant-run\AndroidManifest.xml:11: error: attribute android:appCategory not found.

error: failed processing manifest.

And here is my manifest xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oguzhanaygun.flyingsmurfs" >

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:isGame="true"
    android:appCategory="game"
    android:label="@string/app_name"
    android:theme="@style/GdxTheme" >
    <activity
        android:name="com.oguzhanaygun.flyingsmurfs.AndroidLauncher"
        android:label="@string/app_name"
        android:screenOrientation="landscape"
        android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

回答1:

add tools:targetApi="o" to the application node and target an API level >= 26

... or remove the android:appCategory="game", when targetting an API level < 26.