Mono.AndroidTools.InstallFailedException: Failure

给你一囗甜甜゛ 提交于 2020-02-04 01:10:12

问题


I have run into this issue and my app wont compile. I was trying to use play services in my app but it was giving me resource not found error I got frustrated and removed all the xamarin files and reinstalled everything. that issue went away now this error has popped up. Any help will be appreciated. P.S I am a beginner in android developer. I have copied some parts of the error below:

2>C:\Program Files\Java\jdk1.8.0_91\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\xxxx\AppData\Local\Xamarin\Mono for Android\debug.keystore" 
2>C:\Program Files\Java\jdk1.8.0_91\\bin\jarsigner.exe -keystore "C:\Users\xxxx\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\Messenger.Messenger-Signed-Unaligned.apk C:\Users\xxxx\Desktop\projects\test\Messenger\Messenger\obj\Debug\android\bin\Messenger.Messenger.apk androiddebugkey 
2>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2046-08-06) or after any future revocation date.
2>C:\Users\xxxx\AppData\Local\Android\android-sdk\build-tools\24.0.1\zipalign.exe 4 "C:\Users\xxxx\Desktop\projects\test\Messenger\Messenger\bin\Debug\Messenger.Messenger-Signed-Unaligned.apk" "bin\Debug\\Messenger.Messenger-Signed.apk" 
2>:Deployment failed
2>Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
2>   at Mono.AndroidTools.Internal.AdbOutputParsing.Che`enter code here`ckInstallSuccess(String output, String packageName)
2>   at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyE.<>m__0(Task`1 t)
2>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
2>   at System.Threading.Tasks.Task.Execute()
2>The "InstallPackageAssemblies" task failed unexpectedly.
2>System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
2>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
2>   at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyE.<>m__0(Task`1 t)
2>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
2>   at System.Threading.Tasks.Task.Execute()
2>   --- End of inner exception stack trace ---
2>   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>c__async1.MoveNext()
2>--- End of stack trace from previous location where exception was thrown ---
2>   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2>   at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>c__async0.MoveNext()
2>   --- End of inner exception stack trace ---
2>   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
2>   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
2>   at System.Threading.Tasks.Task.Wait()
2>   at Xamarin.Android.Tasks.InstallPackageAssemblies.Execute()
2>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2>---> (Inner Exception #0) Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
2>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
2>   at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyE.<>m__0(Task`1 t)
2>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
2>   at System.Threading.Tasks.Task.Execute()
2>   --- End of inner exception stack trace ---
2>   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>c__async1.MoveNext()
2>--- End of stack trace from previous location where exception was thrown ---
2>   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2>   at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>c__async0.MoveNext()<---
2>
2>Build FAILED.
2>

回答1:


Use adb to uninstall your app:

adb uninstall <your app's package name>

This cleans all the leftover Xamarin libraries.




回答2:


in android go to

Settings > Applications > All

Remove your app. It might not have the original application name in this list. mine was "com.bla.bla.appname" and was 0.0k in size.



来源:https://stackoverflow.com/questions/38928756/mono-androidtools-installfailedexception-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!