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.
Created attachment 14439 [details]
Demo to reproduce the issue
We have created a simple Xamarin Android app that makes connection with Kaazing libraries to connect to Kaazing Gateway. And we set following options in the configuration:
Application Build -> Linker-> Link SDK assemblies only
The above option is applied for both Debug and Release mode.
The issue we are facing and stop us going production is that in the Release mode we are not able to make the connection to the gateway, the connection is immediately getting closed there is no any specific exception thrown that gives us some clue of what can the issue. Take note that in the *Debug Mode* we are able to to establish connection. It is happening only in release mode.
We have attached the sample of the app that connects to ws://echo.websocket.org. If We change the linker to 'Don't link' it works fine but the apk is too large , so we are guessing the linker is stripping out something that the app is needing in RELEASE mode.
Take note that we tried to ignore Kaazing.Gateway assemblies from the linker options but we still experiencing the same issue. It is getting very difficult for us to debug since there is noting in the XS logs and devices logs.
Version 5.10.1 (build 6)
Installation UUID: aa407210-7847-499c-9f9b-61740be379bf
Mono 4.2.1 (explicit/6dd2d0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402010102
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Apple Developer Tools
Xcode 7.1.1 (9081)
Version: 18.104.22.168 (Starter Edition)
Build date: 2015-12-08 16:20:29-0500
Version: 22.214.171.124 (Trial Edition)
Android SDK: /Users/akramyakubov/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.4 (API level 19)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.1.2
SDK Platform Tools Version: 22.0.0
SDK Build Tools Version: 23 rc3
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Xamarin Android Player
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline
Mac OS X 10.11.2
Darwin Akrams-MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0
Fri Nov 13 19:56:56 PST 2015
I have checked the issue you are seeing. The reason, why it is happening, is that Kaazing.Gateway assembly is using a lot of reflection calls to load assemblies, methods, ... These are linked out and the library probably hides the reflection exceptions.
You can workaround that by adding System.dll to the list of "Ignored assemblies" in the Linker options. If the size of the apk is still too big, you might need to find out what Kaazing.Gateway assembly loads and needs thru reflection and create custom linker configuration for it. See https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/
I wonder if there is way to find out `the library probably hides the reflection exceptions` or to make it visible.
I don't think there's easy way to see these. I would suggest checking the assembly in the browser to see where the reflection happens or use the cmd-line tools like ikdasm and monodis.
Or contact the assembly author to find out what he/she loads with reflection to create custom linker description, see https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/