将unity项目导入Android Studio时遇到问题:
错误:任务:Vuforia7SI:processDebugAndroidTestManifest'的执行失败。
清单合并失败:属性application@debuggable值=(true)来自manifestMerger1358168485974008065。xml:7:18-43
也存在于[:VuforiaWrapper:]AndroidManifest。xml:19:18-44值=(false)。建议:在manifestMerger1358168485974008065处的元素中添加“tools:replace=“android:debugable”。xml:7:5-9:19以重写。
然后,我使用Vuforia 7创建了一个简单的unity(2017.3.0f3)项目,该项目有一个图像目标,并以以下方式导出该项目:
![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应用插件中的更改:“com.Android.application”->应用插件:“com.Android.library”,其他修复是更改“compile”->“Implementation”,所有这些都在gradle from unity项目中)。
但是清单的问题我还没有解决,我按照建议中的说明做了:(我在清单标签中添加了下一行)
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>