(Unity3D-Android) 构建失败,总是

(Unity3D-Android) Failded to build, always

首先:抱歉英语不好。我正在尝试使用 unity3D 游戏引擎构建 android 游戏,但总是出现这两个错误。

这是第一个。

CommandInvokationFailure: Failed to re-package resources.
C:\Android\build-tools.0.3\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/Android\platforms\android-16\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.appcompat -S "C:\Users\Garrom\Desktop\Files\WarCity – Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res"

stderr[
C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-ldltr-v21\values-ldltr-v21.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v23\values-v23.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:216: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:218: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:176: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:189: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.EditText'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:264: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:276: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Title'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:4: error: Error: No resource found that matches the given name: attr 'android:textAlignment'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:8: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:11: error: Error: No resource found that matches the given name: attr 'android:layout_marginEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:14: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:17: error: Error: No resource found that matches the given name: attr 'android:layout_marginStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:20: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:21: error: Error: No resource found that matches the given name: attr 'android:textAlignment'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:25: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:24: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:28: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:31: error: Error: No resource found that matches the given name: attr 'android:layout_toStartOf'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:34: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:38: error: Error: No resource found that matches the given name: attr 'android:layout_toEndOf'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:37: error: Error: No resource found that matches the given name: attr 'android:layout_toStartOf'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:41: error: Error: No resource found that matches the given name: attr 'android:layout_marginStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:45: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:44: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:49: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v17\values-v17.xml:48: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:11: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:13: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:15: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:16: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:27: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:39: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:43: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:47: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.

C:\Users\Garrom\Desktop\Files\WarCity � Android\Temp\StagingArea\android-libraries\appcompat-v7-25.3.1\res\values-v21\values-v21.xml:57:<message truncated>

这是第二个:

UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83 
UnityEditor.HostView:OnGUI()

我正在使用 JDK 1.8,目标是 API 16 级。我已经在 Plugins/Android 中安装了 appcompat v7 25.3.1。我总是收到此错误,但仅在尝试构建 apk 时出现。太令人沮丧了...我是 android 的新手,之前只开发过 windows 游戏,而这种情况以前从未发生过。 谢谢。 -加罗姆

查看您的错误日志,我可以看到您使用的是 Android SDK Build-tools 版本:25.0.3,低于最低版本需要编译支持库。为了成功编译,Android SDK Build-tools 版本必须等于或高于支持库版本。因此,只需将您的 Android SDK 构建工具 更新到 26.0.0 或更高版本即可。