Error to import Unity project with Vuforia to Android Studio 3.0


Keywords:android 


Question: 

I have a problem importing my unity project to Android Studio:

Error:Execution failed for task ':Vuforia7SI:processDebugAndroidTestManifest'.
Manifest merger failed : Attribute application@debuggable value=(true) from manifestMerger1358168485974008065.xml:7:18-43
is also present at [:VuforiaWrapper:] AndroidManifest.xml:19:18-44 value=(false). Suggestion: add 'tools:replace="android:debuggable"' to element at manifestMerger1358168485974008065.xml:7:5-9:19 to override. 

Then i create a simple unity (2017.3.0f3) project with Vuforia 7 with one Image Target and i export the project the following way:

![UnityExport][1] [1]:

so, i imported the folder as a Module in Android Studio (Version 3.0) and i fix the simples errors (change in the gradle apply plugin: 'com.android.application' -> apply plugin: 'com.android.library', other fix was change the "compile" -> "Implementation", all this in the gradle from unity project).

But the problem with the manifest I have not been able to fix, I did what it says in the suggestion: (i added the next line in the Manifest tag)

tools:replace="android:debuggable"

, but a new problems happens:

Error: tools:replace specified at line:15 for attribute android:debuggable, but no new value specified Vuforia7SI main manifest (this file), line 14

Manifest-App:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.assertsoft.pruebaunity">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    tools:replace="android:icon,android:theme,android:debuggable"
    android:label="@string/app_name"

    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Manifest-Unity:

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

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />
<application
    android:banner="@drawable/app_banner"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name"
    tools:replace="android:debuggable"
    android:theme="@style/UnityThemeSelector"
    >
    <activity
        android:name="com.mascayanogerardo.UnityPlayerActivity"
        android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:screenOrientation="portrait">

        <meta-data
            android:name="unityplayer.UnityActivity"
            android:value="true" />
    </activity>

    <meta-data
        android:name="unity.build-id"
        android:value="b6c902c5-a74e-44f0-8501-0d21751bbb47" />
    <meta-data
        android:name="unity.splash-mode"
        android:value="0" />
    <meta-data
        android:name="unity.splash-enable"
        android:value="True" />
    <meta-data
        android:name="android.max_aspect"
        android:value="2.1" />
</application>

<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.front"
    android:required="false" />
<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>

1 Answer: 

You need to add the next line to your Unity Manifest

    android:debuggable="true" //or false

This is to give it a new value

your unity manifest would be like this

<application
android:banner="@drawable/app_banner"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
tools:replace="android:debuggable"
android:debuggable="true"
android:theme="@style/UnityThemeSelector"
>