android: error ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK:
Steps to Reproduce
- Updated the VS for mac Version 8.5 (build 3183)
- Try to install the debug build in phone.
- Fails with the following error.
Expected Behavior : Should successfully into the device.
Actual Behavior Unable to install the app into device. The install fails with the following errors
error ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK: com.test.teaseer.==/base.apk code is missing]
error ADB0010: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess (System.String output, System.String packageName) [0x00152] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbOutputParsing.cs:341
error ADB0010: at Mono.AndroidTools.AndroidDevice+<>c__DisplayClass95_0.<InstallPackage>b__0 (System.Threading.Tasks.Task`1[TResult] t) [0x00016] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/AndroidDevice.cs:753
error ADB0010: at System.Threading.Tasks.ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke () [0x00024] in <f9d1b832704f410aa8ec771f4fe80552>:0
error ADB0010: at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2319
error ADB0010: --- End of stack trace from previous location where exception was thrown ---
error ADB0010:
error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackage (Mono.AndroidTools.AndroidDevice device, System.String apkFile, System.String packageName, System.Boolean reinstall, Mono.AndroidTools.Adb.AdbProgressReporter notifyProgress, System.Threading.CancellationToken token) [0x00189] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:187
error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackage (Mono.AndroidTools.AndroidDevice device, System.String apkFile, System.String packageName, System.Boolean reinstall, Mono.AndroidTools.Adb.AdbProgressReporter notifyProgress, System.Threading.CancellationToken token) [0x003df] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:203
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.InstallPackage () [0x003be] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:433
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.RunAsync (System.Threading.CancellationToken token) [0x003ae] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:217
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.RunLoggedAsync (System.Threading.CancellationToken token) [0x0002f] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:119
error ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.kvaerner.webuild.dev-vlUnvmZEIqEoxbCUR62wrA==: Package /data/app/com.kvaerner.webuild.dev-vlUnvmZEIqEoxbCUR62wrA==/base.apk code is missing]
error ADB0010: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess (System.String output, System.String packageName) [0x00152] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbOutputParsing.cs:341
error ADB0010: at Mono.AndroidTools.AndroidDevice+<>c__DisplayClass95_0.<InstallPackage>b__0 (System.Threading.Tasks.Task`1[TResult] t) [0x00016] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/AndroidDevice.cs:753
error ADB0010: at System.Threading.Tasks.ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke () [0x00024] in <f9d1b832704f410aa8ec771f4fe80552>:0
error ADB0010: at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2319
error ADB0010: --- End of stack trace from previous location where exception was thrown ---
error ADB0010:
error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackage (Mono.AndroidTools.AndroidDevice device, System.String apkFile, System.String packageName, System.Boolean reinstall, Mono.AndroidTools.Adb.AdbProgressReporter notifyProgress, System.Threading.CancellationToken token) [0x00189] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:187
error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackage (Mono.AndroidTools.AndroidDevice device, System.String apkFile, System.String packageName, System.Boolean reinstall, Mono.AndroidTools.Adb.AdbProgressReporter notifyProgress, System.Threading.CancellationToken token) [0x003df] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:203
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.InstallPackage () [0x003be] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:433
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.RunAsync (System.Threading.CancellationToken token) [0x003ae] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:217
error ADB0010: at Xamarin.AndroidTools.AndroidDeploySession.RunLoggedAsync (System.Threading.CancellationToken token) [0x0002f] in /Users/runner/runners/2.165.0/work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:119
Done executing task "InstallPackageAssemblies" -- FAILED.
Version Information
=== Visual Studio Enterprise 2019 for Mac ===
Version 8.5 (build 3183) Installation UUID: aa0315c4-d53f-442d-8e1e-95d85e467894 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.14.1.39 (d16-5 / 30e8706b4)
Package version: 608000123
=== Mono Framework MDK ===
Runtime: Mono 6.8.0.123 (2019-10/1d0d939dc30) (64-bit) Package version: 608000123
=== Roslyn (Language Service) ===
3.5.0-beta4-20125-04+1baa0b3063238ed752ad1f0368b1df6b6901373e
=== NuGet ===
Version: 5.4.0.6315
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.1.200/Sdks SDK Versions: 3.1.200 3.1.102 3.1.101 3.1.100 3.1.100-preview3-014645 3.0.100 2.1.701 2.1.504 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 3.1.2 3.1.1 3.1.0 3.1.0-preview3.19553.2 3.0.0 2.1.16 2.1.15 2.1.14 2.1.13 2.1.12 2.1.8
=== Xamarin.Profiler ===
Version: 1.6.13.11 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: 10.2.0.100 (Visual Studio Enterprise) Commit: xamarin-android/d16-5/988c811 Android SDK: /Users/developer/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 8.1 (API level 27)
SDK Tools Version: 26.1.1 SDK Platform Tools Version: 29.0.6 SDK Build Tools Version: 30.0.0 rc2
Build Information: Mono: c0c5c78 Java.Interop: xamarin/java.interop/d16-5@fc18c54 ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.28.0@46204c4 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/developer/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.5.0.39 Hash: 6fb4c79 Branch: remotes/origin/d16-5 Build date: 2020-02-20 23:25:56 UTC
=== Android Device Manager ===
Version: 16.5.0.71 Hash: 49194e8 Branch: remotes/origin/d16-5 Build date: 2020-02-20 23:26:18 UTC
=== Xamarin Inspector ===
Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1
=== Xamarin Designer ===
Version: 16.5.0.471 Hash: 35aa4889d Branch: remotes/origin/d16-5 Build date: 2020-02-25 00:52:08 UTC
=== Apple Developer Tools ===
Xcode 11.3.1 (15715) Build 11C504
=== Xamarin.Mac ===
Version: 6.14.1.39 (Visual Studio Enterprise) Hash: 30e8706b4 Branch: d16-5 Build date: 2020-02-20 16:41:47-0500
=== Xamarin.iOS ===
Version: 13.14.1.39 (Visual Studio Enterprise) Hash: 30e8706b4 Branch: d16-5 Build date: 2020-02-20 16:41:48-0500
=== Build Information ===
Release ID: 805003183 Git revision: 60e06e010baa677204535600661dda3fb4677c2f Build date: 2020-03-20 06:18:03-04 Build branch: release-8.5 Xamarin extensions: 60e06e010baa677204535600661dda3fb4677c2f
=== Operating System ===
Mac OS X 10.14.6 Darwin 18.7.0 Darwin Kernel Version 18.7.0 Sat Oct 12 00:02:19 PDT 2019 root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64
Can you please let me know what needs to be done to revert to previous version of xamarin android and VS for Mac. Where can we download these packages for Mac. Currently blocked due to the issue.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 17 (10 by maintainers)
Commits related to this issue
- [Xamarin.Android.Build.Tasks] trailing / causes missing classes.dex Fixes: https://github.com/xamarin/xamarin-android/issues/4478 Fixes: https://github.com/xamarin/xamarin-android/issues/4486 We wit... — committed to jonathanpeppers/xamarin-android by jonathanpeppers 7 years ago
- [Xamarin.Android.Build.Tasks] trailing / causes missing classes.dex Fixes: https://github.com/xamarin/xamarin-android/issues/4478 Fixes: https://github.com/xamarin/xamarin-android/issues/4486 We wit... — committed to jonathanpeppers/xamarin-android by jonathanpeppers 7 years ago
- [Xamarin.Android.Build.Tasks] trailing / causes missing classes.dex (#4505) Fixes: https://github.com/xamarin/xamarin-android/issues/4478 Fixes: https://github.com/xamarin/xamarin-android/issues/448... — committed to dotnet/android by jonathanpeppers 7 years ago
- [Xamarin.Android.Build.Tasks] trailing / causes missing classes.dex (#4505) Fixes: https://github.com/xamarin/xamarin-android/issues/4478 Fixes: https://github.com/xamarin/xamarin-android/issues/448... — committed to dotnet/android by jonathanpeppers 7 years ago
@vravindranath as a workaround can you try this at the bottom of your
.csprojfile?This should allow you to keep using
dx. Let us know if that works, thanks.You can use any
.ziputility to look at the.apkfile. All Java/Kotlin code is in a singleclasses.dexfile that is expected to be in the root of the archive.This issue is long fixed, so your problem is likely something completely different.
Steps to reproduce
msbuild -restore -p:Configuration=Release -t:Install4478TestCase.zip
Expected behavior
The classes.dex file generated by the
CompileToDalviktask should be output to obj/Release/android/bin/classes.dex.To produce this expected behavior with the test case:
The obj directory at the top level of the test case started off as a full copy of the obj directory that I had moved there to save for later comparisons. But I was able to trim it down to just a small hierarchy, containing a few directories and no files.
It seems the presence of that directory for some reason changes the path separator behavior in MSBuild.
Actual behavior
The classes.dex file is output to obj/Release/android/bin/classes/classes.dex:
Log files
logs.zip
The problem seems to be caused by a difference in path separator characters.
For example, the first difference between the Expected and Actual diagnostic MSBuild output log files is:
And the important difference is:
A possible workaround
I was able to work around the problem by adjusting Xamarin.Android.Common.targets to account for the different path separator:
(The
D8task avoids this picky dependence on the presence or absence of the path separator character, so switching to the D8 DEX compiler is also a workaround for the attached test case.)Version info
Mono Framework MDK 6.8.0.123 (2019-10/1d0d939dc30) MSBuild 16.5.0.16201
macOS 10.14.6 US English locale, US Pacific time zone