Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Xamarin Android update (8.1.5.0) won't build in release mode, no such file or directory (classes.zip) error #1257

Closed
justintoth opened this issue Jan 31, 2018 · 3 comments
Assignees

Comments

@justintoth
Copy link

Steps to Reproduce

  1. Upgrade to latest Xamarin Android update, 8.1.5.0.
  2. Switch to a release build.
  3. Enable proguard.
  4. Try to build the solution.

Expected Behavior

The solution builds in release mode.

Actual Behavior

The solution doesn't build in release mode, it gives the following error:

java.io.IOException: Can't read [/Users/justintoth/Documents/rpr-mobile/android-application/obj/Release-Prod/android/bin/classes.zip] (No such file or directory)

Build log here.

Version Information

=== Visual Studio Community 2017 for Mac ===

Version 7.3.3 (build 7)
Installation UUID: 62cf1ad2-0db0-41e1-ac78-aeb509d79f60
Runtime:
Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 504010007

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.0
1.1.1
1.0.4
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
2.0.0
1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.1.5.0 (Visual Studio Community)
Android SDK: /android/sdk
Supported Android versions:
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 27.0.3

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.iOS ===

Version: 11.6.1.4 (Visual Studio Community)
Hash: db807ec9
Branch: xcode9.2
Build date: 2018-01-10 16:45:48-0500

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: 4.0.0.216 (Visual Studio Community)

=== Build Information ===

Release ID: 703030007
Git revision: 125911fb4accc4309b2cee5c81c970c7cff9b0e0
Build date: 2018-01-22 17:46:46-05
Xamarin addins: 463e21a6d9d4f6b57f923df376fff093a1dd9404
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.13.2
Darwin 17.3.0 Darwin Kernel Version 17.3.0
Thu Nov 9 18:09:22 PST 2017
root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1

Log File

https://gist.github.com/justintoth/1072e75924307758e7c7529ca962e642

@JonDouglas
Copy link
Contributor

JonDouglas commented Jan 31, 2018

Hey @justintoth

Thanks for the report! Unfortunately your reproduction steps do not quite reproduce for me. I believe there are a few discrepancies here.

  1. The reproduction steps are assuming an existing application? I do not believe a File -> New Android Project will demonstrate this.
  2. The path /Users/justintoth/Documents/rpr-mobile/android-application/obj/Release-Prod/android/bin/classes.zip seems to differ from a traditional Release configuration.

I would recommend checking each of these paths from your proguard invocation(specifically the failure paths) to ensure they are all valid on disk locally:

java -jar /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/proguard/lib/proguard.jar -include '/android/sdk//tools/proguard/proguard-android.txt' -include 'obj/Release-Prod/proguard/proguard_xamarin.cfg' -include 'obj/Release-Prod/proguard/proguard_project_references.cfg' -include 'obj/Release-Prod/proguard/proguard_project_primary.cfg' -include 'proguard.cfg' -include '/Users/justintoth/Documents/rpr-mobile/packages/Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0/build/MonoAndroid80/../../proguard/proguard.txt' -include '/Users/justintoth/Documents/rpr-mobile/packages/Xamarin.Android.Support.Core.UI.26.1.0.1/build/MonoAndroid80/../../proguard/proguard.txt' -include '/Users/justintoth/Documents/rpr-mobile/packages/Xamarin.Android.Support.Media.Compat.26.1.0.1/build/MonoAndroid80/../../proguard/proguard.txt' -include '/Users/justintoth/Documents/rpr-mobile/packages/Xamarin.Android.Support.v7.RecyclerView.26.1.0.1/build/MonoAndroid80/../../proguard/proguard.txt' -include '/Users/justintoth/Documents/rpr-mobile/packages/Xamarin.Android.Support.Animated.Vector.Drawable.26.1.0.1/build/MonoAndroid80/../../proguard/proguard.txt' -include 'obj/Release-Prod/XbdMerge/proguard/1f973a1f0.txt' -include 'obj/Release-Prod/XbdMerge/proguard/dc663e480.txt' -injars 'obj/Release-Prod/android/bin/classes/../classes.zip':'/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v8.0/mono.android.jar':'/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/android-support-multidex.jar':'obj/Release-Prod/lp/1/jl/bin/classes.jar':'obj/Release-Prod/lp/10/jl/arch-lifecycle-common.jar':'obj/Release-Prod/lp/11/jl/bin/classes.jar':'obj/Release-Prod/lp/12/jl/bin/classes.jar':'obj/Release-Prod/lp/14/jl/bin/classes.jar':'obj/Release-Prod/lp/15/jl/bin/classes.jar':'obj/Release-Prod/lp/16/jl/bin/classes.jar':'obj/Release-Prod/lp/17/jl/bin/classes.jar':'obj/Release-Prod/lp/18/jl/bin/classes.jar':'obj/Release-Prod/lp/19/jl/bin/classes.jar':'obj/Release-Prod/lp/20/jl/bin/classes.jar':'obj/Release-Prod/lp/21/jl/bin/classes.jar':'obj/Release-Prod/lp/22/jl/bin/classes.jar':'obj/Release-Prod/lp/23/jl/bin/classes.jar':'obj/Release-Prod/lp/24/jl/classes.jar':'obj/Release-Prod/lp/25/jl/classes.jar':'obj/Release-Prod/lp/26/jl/classes.jar':'obj/Release-Prod/lp/27/jl/classes.jar':'obj/Release-Prod/lp/28/jl/classes.jar':'obj/Release-Prod/lp/29/jl/classes.jar':'obj/Release-Prod/lp/3/jl/localytics-xamarin-patch.jar':'obj/Release-Prod/lp/3/jl/localytics.jar':'obj/Release-Prod/lp/30/jl/classes.jar':'obj/Release-Prod/lp/31/jl/classes.jar':'obj/Release-Prod/lp/32/jl/classes.jar':'obj/Release-Prod/lp/33/jl/classes.jar':'obj/Release-Prod/lp/34/jl/classes.jar':'obj/Release-Prod/lp/35/jl/classes.jar':'obj/Release-Prod/lp/36/jl/classes.jar':'obj/Release-Prod/lp/37/jl/classes.jar':'obj/Release-Prod/lp/9/jl/arch-core-common.jar' -libraryjars '/android/sdk/platforms/android-26/android.jar':'/android/sdk/platforms/android-26/optional/org.apache.http.legacy.jar' -outjars obj/Release-Prod/proguard/__proguard_output__.jar -optimizations !code/allocation/variable 

e.g:

-injars 'obj/Release-Prod/android/bin/classes/../classes.zip'

This will help us pinpoint the area this is occuring. Also, if it's possible, can you please upload a reproduction project that demonstrates this issue? This will help us get a better idea of the situation.

I would guess this was introduced from the following PR: https://github.com/xamarin/xamarin-android/pull/1142/files in which the Proguard task adds the additional ../ to resolve the initial inception issue.

@dellis1972
Copy link
Contributor

@justintoth does this happen after a Clean -> Build in Release or an immediate build after upgrade?

Looking at your build output [1] the _CompileJava target was skipped, which suggests there was a previous build present. If that was the case then I would expect this since we moved the location of the classes.zip in the PR which @JonDouglas mentioned.

Can you try a Build from Clean please (delete bin/obj) and then if it is still a problem gist the diagnostic output from the build. You can turn on diagnostic build output in VSForMac by going to the Preferences Menu and then Build and changing the Log Verbosity.

[1] https://gist.github.com/justintoth/1072e75924307758e7c7529ca962e642#file-gistfile1-txt-L169

@justintoth
Copy link
Author

I just tried the upgrade again (I had rolled back yesterday to be in a working state) and now it's working. I had cleaned before building and it wasn't working, but now it is, so probably just something went wrong with the first install. Thanks for the fast replies!

@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants