我将Unity项目导入Android Studio时遇到问题:
错误:任务执行失败':Vuforia7SI:processDebugAndroidTestManifest'。清单合并失败:来自manifestMerger1358168485974008065.xml:7:18-43的属性应用程序@ debuggable value =(true)也出现在[:VuforiaWrapper:] AndroidManifest.xml:19:18-44 value =(false)。建议:在manifestMerger1358168485974008065.xml:7:5-9:19中将'tools:replace =“android:debuggable”'添加到元素中以覆盖。
然后我创建一个简单的统一(2017.3.0f3)项目与Vuforia 7与一个图像目标,我按以下方式导出项目:
![UnityExport] [1] [1]:https://scontent.fscl1-1.fna.fbcdn.net/v/t34.0-12/26647947_10214892485526500_911683330_n.png?oh=6c754a1974af95bdb50d80a8b302d83e&oe=5A4EA6B7
因此,我在Android Studio(版本3.0)中将该文件夹作为模块导入,并修复了简单错误(在gradle apply plugin中更改:'com.android.application' - > apply plugin:'com.android.library',其他修复是改变“编译” - >“实现”,所有这一切都在团结项目的gradle中。
但是我无法修复清单的问题,我做了它在建议中所说的内容:(我在Manifest标记中添加了下一行)
tools:replace="android:debuggable"
但是会出现一个新问题:
Error: tools:replace specified at line:15 for attribute android:debuggable, but no new value specified Vuforia7SI main manifest (this file), line 14
体现-应用程序:
<?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>
清单-统一:
<?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>
您需要在Unity Manifest中添加下一行
android:debuggable="true" //or false
这是为了给它一个新的价值
你的团结清单就是这样的
<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"
>