Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
While trying to do a binding for New Relic's Android agent, I'm getting an error message when packaging that one of the reference jars is not a valid zip file, but I can successfully open it up with tools like Jarzilla.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task BuildApk: /Users/davidhathaway/Projects/dwhathaway/xamarin-bindings/NewRelic/NewRelicDroidSample/obj/Debug/__library_projects__/NewRelic.Binding.Droid/library_project_imports/__reference__class.rewriter.jar is not a valid zip file (NewRelicDroidSample)
Build log is here, which shows that the app did build successfully:
Reproduction can be found at - just clean/rebuild/run the "NewRelicDroidSample" app.
=== Xamarin Studio ===
Version 5.10 (build 860)
Installation UUID: e16d0ece-7353-4886-83b5-86d62e1d480c
Mono 4.2.1 (explicit/8862921)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402010091
=== Xamarin.Profiler ===
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Apple Developer Tools ===
Xcode 7.1 (9079)
=== Xamarin.iOS ===
Version: 126.96.36.199 (Enterprise Edition)
Build date: 2015-10-28 19:11:03-0400
=== Xamarin.Android ===
Version: 188.8.131.52 (Enterprise Edition)
Android SDK: /Users/davidhathaway/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1
Java SDK: /usr
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 184.108.40.206 (Enterprise Edition)
=== Build Information ===
Release ID: 510000860
Git revision: 7c46a0b709d51ad5d5a5ed90a4671cc7b6928e62
Build date: 2015-10-29 17:17:52-04
Xamarin addins: b9337905aca5dc276190d78819728a59cda33a43
Build lane: monodevelop-lion-cycle6
=== Operating System ===
Mac OS X 10.10.5
Darwin dwhathaway-macbook.local 14.5.0 Darwin Kernel Version 14.5.0
Tue Sep 1 21:23:09 PDT 2015
The sample link does not work: "This account's public links are generating too much traffic and have been temporarily disabled!"
The project contains broken links to your local files:
/svn/monodroid/monodroid/out/lib/xbuild/Xamarin/Android/Xamarin.Android.Bindings.targets: error : Specified reference jar not found: ../../../../../../../Downloads/okhttp-2.5.0.jar
This is the first one I saw, there might be more.
I manually downloaded okhttp-2.5.0.jar from maven central, replaced in the .csproj, set build item as EmbeddedReferenceJar and could build without such a jar problem.
Can *you* or anyone else in your team reproduce the issue? I'll also ask at Android team.
This issue is reproducible by running the Android app itself. Consolidated repro (including OkHttp) can be found here:
Also including a video recording of the problem:
Steps to reproduce:
1. Build the solution. Note that everything builds fine.
2. Set the '' project as your startup project, and run.
3. Receive packaging error on deployment.
Created attachment 13686 [details]
diagnostic build containing relevant exception
Radek figured out that the mentioned jar (class.rewriter.jar) is indeed problematic and it contains META-INF/LICENSE.txt *twice*. While some tools wouldn't complain about that it is indeed invalid zip.
While we could still do some workaround, it is basically invalid zip that should be corrected.
unpacked / repacked the jar with the following command, and it's fine now. Even though the jar showed a duplicate license.txt file when I opened it with Jarzilla, exploding it into a folder did not result in duplicate files. Simply unpacking (jar -xvf class.rewriter.jar) and repacking (jar -cvf class.rewriter2.jar .)
After re-packing, I'm now able to compile, and deploy the app including the bound libraries.
Marking resolved. JAR file was invalid. repacking JAR fixed the issue.