android 无法将APK安装到设备

aiqt4smr  于 2023-05-15  发布在  Android
关注(0)|答案(5)|浏览(199)

我更新了我的jdk和sdk,当我采取建设apk是建设,但不工作其损坏。通过USB调试,我得到了这个错误。我正在使用Unity 2018.3.9f1。请解决这个问题。
在Unity 5.6.6 APK正在建设成功.

CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
D:/Babji Unity/android-sdks\platform-tools\adb.exe -s "cbe79ceb" install -r "D:\Babji Unity\Test New Unity\TestAsset.apk"

stderr[
adb: failed to install D:\Babji Unity\Test New Unity\TestAsset.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl839836997.tmp/base.apk: AndroidManifest.xml]
]
stdout[
Performing Streamed Install
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidDevice.Exec (System.String[] command, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidDevice.Install (System.String apkfile) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<UploadAPK>c__AnonStorey3.<>m__0 () (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension+LaunchProgressTaskManager taskManager) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<LaunchBuildOnTarget>c__AnonStorey0.<>m__2 () (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at C:/buildslave/unity/build/Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs:45)
UnityEditor.PostprocessBuildPlayer+<LaunchOnTargets>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:210)
UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:229)
UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:173)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
tzxcd3kk

tzxcd3kk1#

尝试卸载已安装在耳机上的APK。

6jjcrrmo

6jjcrrmo2#

您应该删除以前安装的应用程序,并使用该软件清理应用程序的其余部分。
它似乎是以前安装的应用程序,并导致该高速缓存无法继续。
我已经尝试了很多方法,最简单的修复方法就是重启手机或虚拟机

vaj7vani

vaj7vani3#

我有解决方案。
在任何其他驱动器中创建新文件夹,并将文件夹从旧sdk逐个复制到新sdk文件夹,并在每次粘贴文件夹时进行构建。
在我的情况下,有一个额外的文件夹被损坏,发现像这样,我删除了该文件夹,它现在工作正常。

zfycwa2u

zfycwa2u4#

在Build Settings中单击“Build and Run”后,我在将APK安装到设备上时遇到了问题。构建成功完成,但我得到了错误Unable to install APK to device,但通过更新Unity Hub解决了这个问题。在Unity Hub菜单中,顶部有一个通知,说有更新可用。更新Unity Hub后,我能够安装APK并在手机上成功运行游戏。

tktrz96b

tktrz96b5#

这就是我的工作:
1.卸载我的Android设备上的应用程序(Nishchhal Bakshi的答案)。
1.清除Unity缓存(顶部答案here)。

相关问题