Steps to Reproduce
- Develop your XamarinAndroid app that accesses some service on the internet, e.g. by instantiating a
System.Net.Sockets.TcpClient object.
- Create .APK file for it (note: in this step, developer is an Android noob so he doesn't mark any permissions on the AndroidManifest.xml section of the project options).
- Copy the .APK file to your phone's SD card.
- Use the file explorer on your phone to install the .APK file.
- Run the application inside your phone: it doesn't work (e.g. if the connection to the internet is done in a Task, app doesn't crash). Developer might be confused of why it doesn't work so then he decides to do something to debug it:
- Run the application it on your emulator, or on your device deploying via USB with Visual Studio for Mac.
Current Behavior
App works fine when deployed this way (emulator or USB). Therefore the problem cannot be debugged/investigated by the developer.
Expected Behavior
It should fail to access to the internet because developer hasn't enabled INTERNET permission on the AndroidManifest.xml. An example of an exception that may happen is:
03-22 12:24:04.983 30369 30369 I MonoDroid: UNHANDLED EXCEPTION:
03-22 12:24:05.018 30369 30369 I MonoDroid: System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: Access denied
03-22 12:24:05.018 30369 30369 I MonoDroid: at System.Net.Sockets.Socket..ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x00069] in <6d05f74c602c4b558ceacaf5cfeb699b>:0
03-22 12:24:05.018 30369 30369 I MonoDroid: at System.Net.Sockets.TcpClient.initialize () [0x00000] in <6d05f74c602c4b558ceacaf5cfeb699b>:0
03-22 12:24:05.018 30369 30369 I MonoDroid: at System.Net.Sockets.TcpClient..ctor (System.Net.Sockets.AddressFamily family) [0x00046] in <6d05f74c602c4b558ceacaf5cfeb699b>:0
03-22 12:24:05.018 30369 30369 I MonoDroid: at System.Net.Sockets.TcpClient..ctor () [0x00000] in <6d05f74c602c4b558ceacaf5cfeb699b>:0
Version Information
Visual Studio Community 2017 for Mac
Version 7.4 (build 1033)
Installation UUID: fd06ff65-69de-47ae-8b99-ddf257032b7c
Runtime:
Mono 5.8.0.129 (2017-10/835a98d8559) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 508000129
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Apple Developer Tools
Xcode 9.2 (13772)
Build 9C40b
Xamarin.Mac
Version: 4.2.0.20 (Visual Studio Community)
Xamarin.iOS
Version: 11.8.0.20 (Visual Studio Community)
Hash: 1c6f300e
Branch: d15-6
Build date: 2018-02-07 23:42:40-0500
Xamarin.Android
Version: 8.2.0.15 (Visual Studio Community)
Android SDK: /Users/andres/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.1 (API level 25)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.2
SDK Build Tools Version: 26.0.3
Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Xamarin Inspector
Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1
Build Information
Release ID: 704001033
Git revision: 053991068f3c88497d3e5cc52fe7fdf57c28b62f
Build date: 2018-02-28 05:02:28-05
Xamarin addins: cc3283953e0af0b8bfab1bdfdf847d9e403c4606
Build lane: monodevelop-lion-d15-6
Operating System
Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
Fri Sep 29 18:27:05 PDT 2017
root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64
Enabled user installed addins
Internet of Things (IoT) development (Preview) 7.1
Log File
N/A
Steps to Reproduce
System.Net.Sockets.TcpClientobject.Current Behavior
App works fine when deployed this way (emulator or USB). Therefore the problem cannot be debugged/investigated by the developer.
Expected Behavior
It should fail to access to the internet because developer hasn't enabled INTERNET permission on the AndroidManifest.xml. An example of an exception that may happen is:
Version Information
Log File
N/A