Hi, I want to test the Android in the latest 5.6.2 asp.netZero release.
Referencing: https://aspnetzero.com/Documents/Development-Guide-Xamarin https://aspnetzero.com/Documents/Developing-Step-By-Step-Xamarin
And the newest release of VS2017 (see at the very end of this post for complete infos there)
I also have the appropriate Android SDKs installed corresponding to the several Android Emulators that I installed directly from the VS2017 setup-dialog. Everything compiles fine. No errors. Note: I have used Xamarin with blue-tooth pluggins before and have a running PlayStore-Xamarin App, so I'm not quite the beginner here.
So, I start the Web.Host in a CMD with dotnet run and it starts fine on the pre-defined port as:
C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Web.Host>dotnet run Using launch settings from C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Web.Host\Properties\launchSettings.json... Hosting environment: Development Content root path: C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Web.Host Now listening on: http://[::]:22742 Application started. Press Ctrl+C to shut down.
I then start the star.Mobile.Droid from VS2017 in debug mode to (for example) a Marshmallow Tablet Android 6, API 23. I have this API/SDK installed and it is properly within the project supported sdk. I have not changed a thing in the project exept the
star.ApiClient.DEbugServerIpAddresses. Hierin may be the confusion. Here it is:
namespace ptw.de.PTW100.ApiClient
{
public static class DebugServerIpAddresses
{
//https://aspnetzero.com/Documents/Developing-Step-By-Step-Xamarin
// https://aspnetzero.com/Documents/Development-Guide-Xamarin
//You can use Emulators.Android, Emulators.Gennymotion or LocalhostIp based on your needs.
//public static string Current => LocalhostIp;
public static string Current => LocalhostIp;
//You can configure your computer's IP adress for external access (if Current = LocalhostIp)
private const string LocalhostIp = Emulators.Android; //"192.168.2.101";
//Loopback addresses by emulators.
private static class Emulators
{
public const string Android = "10.0.2.2 ";
public const string Gennymotion = "10.0.3.2";
}
}
}
I may be confused (after reading severa times) as to the IP used by the mobile app to access the localhost:22742 Host API. Which setting is that and where?
When start the Mobile App from VS2017, everything looks great, the Emulator starts, the Android-device appears, and the Xamarin.Diagnostics console in VS2017 is as follows:
[I:]: Found Xamarin.Android 9.1.0.17
[I:sdk]: Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\Xamarin\Android
[I:sdk]: Framework path: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateAndroidNdkLocation: ``, result=False
[I:]: Looking for Android NDK...
[D:]: ValidateJavaSdkLocation: `C:\Program Files\Java\jdk1.8.0_161`, result=True
[I:]: Tracking android devices started
[D:]: Tracking avd started
[D:]: avd watcher *.ini path: 'C:\Users\Hubert\.android\avd'
[D:]: Cannot load avd devices from 'C:\Users\Hubert\.android\avd'
[D:]: TrackDeviceTask got:
[D:]: avd watcher: got device list from avd with 0 devices
[I:]: Got new device list from adb with 0 devices
[D:]: VS emulator watcher: got device list from VS emulator with 2 devices
[I:]: Looking for Android SDK...
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: VS emulator watcher: got device list from VS emulator with 2 devices
[D:]: VS emulator watcher: got device list from VS emulator with 3 devices
[D:]: VS emulator watcher: got device list from VS emulator with 4 devices
But nothing else happens. It hangs. I do not see a new app starting/appearing on the Android, and VS2017 is "ready" but not actively debugging... It is apparently looking for a device and stuck waiting? Funny thing are the messages above recarding the AVD and I do not see any devices in the Device Log nor do I in the Android Device Manager. The Android Device Manager will not even start. No errors.
Any tips appreciated.
Network Infro from the currently selected/running Android Emulator Device
Emulator Adapter # 1: (Used only for diagnostic purposes) Physical address: 02DEDEDEDE02 Virtual switch: Windows Phone Emulator Internal Switch Network addresses: fe80::de:deff:fede:de02 (Preferred) 169.254.56.136 (Preferred) Emulator Adapter [#2](https://support.aspnetzero.com/QA/Questions/2): Physical address: 00155DC0AEED Virtual switch: Intel(R) Ethernet Connection (4) I219-LM Virtual Switch Network addresses: 2003:c3:2f12:d16c:215:5dff:fec0:aeed (Preferred) 2003:c3:2f12:d12f:215:5dff:fec0:aeed (Preferred) fe80::215:5dff:fec0:aeed (Preferred) 192.168.2.111 (Preferred) Desktop Adapter [#1](https://support.aspnetzero.com/QA/Questions/1): Physical address: 1A15E29DE948 Network addresses: 172.21.45.81 fe80::9da4:6263:fedd:65c5 Desktop Adapter [#2](https://support.aspnetzero.com/QA/Questions/2): Physical address: 106530FA04C3 Network addresses: 192.168.2.101 fe80::61ee:be72:270c:9aa1 2003:c3:2f12:d16c:cb0:fa22:2293:a657 2003:c3:2f12:d12f:61ee:be72:270c:9aa1 2003:c3:2f12:d16c:61ee:be72:270c:9aa1 Desktop Adapter [#3](https://support.aspnetzero.com/QA/Questions/3): Physical address: 00155DC0AEE9 Network addresses: 169.254.80.80 fe80::e07b:8f9:5df8:b695
VS 2017 Infos
Microsoft Visual Studio Professional 2017 Preview Version 15.9.0 Preview 2.0 VisualStudio.15.Preview/15.9.0-pre.2.0+28107.0 Microsoft .NET Framework Version 4.7.03056
Installed Version: Professional
Visual C++ 2017 00369-60000-00001-AA216 Microsoft Visual C++ 2017
Application Insights Tools for Visual Studio Package 8.14.10823.1 Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.9.02026.0 ASP.NET and Web Tools 2017
ASP.NET Core Blazor Language Services 0.5.1-rtm-10384
ASP.NET Core Razor Language Services 15.8.31590 Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2017 5.2.60801.0 For additional information, visit https://www.asp.net/
AspNetZeroRadTool Extension 1.0 AspNetZeroRadTool Visual Studio Extension Detailed Info
Azure App Service Tools v3.0.0 15.9.02003.0 Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.3.3000.2 Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 15.9.02009.0 Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.3.3000.2 Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 2.10.0-beta2-63307-03 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter 15.9.18236.1 Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Extensibility Message Bus 1.1.49 (remotes/origin/d15-8@ee674f3) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events
JavaScript Language Service 2.0 JavaScript Language Service
JavaScript Project System 2.0 JavaScript Project System
JetBrains ReSharper Ultimate 2018.1 Build 112.0.20180414.70444 JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2018 JetBrains, Inc.
Microsoft Azure HDInsight Azure Node 2.3.3000.2 HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.3.3000.2 Language service for Hive query
Microsoft Azure Service Fabric Tools for Visual Studio 2.3 Microsoft Azure Service Fabric Tools for Visual Studio
Microsoft Azure Stream Analytics Language Service 2.3.3000.2 Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.10730.2
Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 1.0 Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package
MLGen Package Extension 1.0 MLGen Package Visual Studio Extension Detailed Info
Mono Debugging for Visual Studio 4.13.8-pre (545dd7d) Support for debugging Mono processes with Visual Studio.
Node.js Tools 1.4.20802.1 Commit Hash:97e1085d8b4b8e3e51c398e910177f87e86d135e Adds support for developing and debugging Node.js apps in Visual Studio
NuGet Package Manager 4.6.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info
Python 15.9.18236.1 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Python - Django support 15.9.18236.1 Provides templates and integration for the Django web framework.
Python - IronPython support 15.9.18236.1 Provides templates and integration for IronPython-based projects.
Python - Profiling support 15.9.18236.1 Profiling support for Python projects.
ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info
SQL Server Data Tools 15.1.61808.07020 Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0 Hosting json editor into a tool window
TypeScript Tools 15.8.20801.2001 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 2.10.0-beta2-63307-03 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: 0e85dd17f8014834a3e340baa784993081fc5e76. Microsoft Visual F# Tools 10.2 for F# 4.5
Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers
Visual Studio Tools for Unity 3.8.0.6 Visual Studio Tools for Unity
Visual Studio Tools for Universal Windows Apps 15.0.28107.00 The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
VisualStudio.Mac 1.0 Mac Extension for Visual Studio
Xamarin 4.12.2.1 (d15-9-p2@2bc03d4a6) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.14.242 (c92fb2dd2) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 1.1.116 (466cd65) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 9.1.0.17 (HEAD/ee0bcdf64) Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 11.16.0.22 (bd81f1c) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
22 Answer(s)
-
0
First of all better set LocalhostIp as your network ip
private const string LocalhostIp = "192.168.1.XX";
Secondly in some cases visual studio cannot attach to the emulator's debugger. So open the emulator first, wait it to settle down then start your app.
-
0
Thanks Alper, There does not seem to be a way to reply to your suggestion, and the "Answer" button below is disabled, only the "answer and close" is enabled. This is NOT closed. See:
OK, I changed toe LocalhostIp to be the machine running my star.Web.Host instance.
However, starting the emulator first causes studio to exit with an "error" that the emulator is already running, see below. I tried this both with F5 debug mode and a simple "deploy to device", same result with both.
3>Done building project "ptw.de.PTW100.Application.Client.csproj". 4>------ Build started: Project: ptw.de.PTW100.Mobile.Shared, Configuration: Debug Any CPU ------ 4>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\ptw.de.PTW100.Mobile.Shared.csproj : warning NU1701: Package 'Microsoft.Bcl 1.1.6' was restored using '.NETPortable,Version=v0.0,Profile=Profile259, .NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. 4>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\ptw.de.PTW100.Mobile.Shared.csproj : warning NU1701: Package 'Microsoft.Bcl.Async 1.0.165' was restored using '.NETPortable,Version=v0.0,Profile=Profile259, .NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. 4>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\ptw.de.PTW100.Mobile.Shared.csproj : warning NU1701: Package 'modernhttpclient 2.4.2' was restored using '.NETPortable,Version=v0.0,Profile=Profile259, .NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. 4>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\ptw.de.PTW100.Mobile.Shared.csproj : warning NU1701: Package 'PCLStorage 1.0.2' was restored using '.NETPortable,Version=v0.0,Profile=Profile259, .NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. 4>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\ptw.de.PTW100.Mobile.Shared.csproj : warning NU1701: Package 'Xam.FormsPlugin.Iconize 1.0.10' was restored using '.NETPortable,Version=v0.0,Profile=Profile259, .NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. 4>C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "ImageCircle.Forms.Plugin.Abstractions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 4>Controls\HideableToolbarItem.cs(10,60,10,172): warning CS0618: 'BindableProperty.Create<TDeclarer, TPropertyType>(Expression<Func<TDeclarer, TPropertyType>>, TPropertyType, BindingMode, BindableProperty.ValidateValueDelegate<TPropertyType>, BindableProperty.BindingPropertyChangedDelegate<TPropertyType>, BindableProperty.BindingPropertyChangingDelegate<TPropertyType>, BindableProperty.CoerceValueDelegate<TPropertyType>, BindableProperty.CreateDefaultValueDelegate<TDeclarer, TPropertyType>)' is obsolete: 'Create<> (generic) is obsolete as of version 2.1.0 and is no longer supported.' 4>Controls\CardView.cs(14,17,14,29): warning CS0618: 'Frame.OutlineColor' is obsolete: 'OutlineColor is obsolete as of version 3.0.0. Please use BorderColor instead.' 4>ptw.de.PTW100.Mobile.Shared -> C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\bin\Debug\netstandard2.0\ptw.de.PTW100.Mobile.Shared.dll 4>Done building project "ptw.de.PTW100.Mobile.Shared.csproj". 5>------ Build started: Project: ptw.de.PTW100.Mobile.Droid, Configuration: Debug Any CPU ------ 5>C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 5>C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Droid\Renderer\CropViewRenderer.cs(12,5,128,6): warning CS0618: 'PageRenderer.PageRenderer()' is obsolete: 'This constructor is obsolete as of version 2.5. Please use PageRenderer(Context) instead.' 5> ptw.de.PTW100.Mobile.Droid -> C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Droid\bin\Debug\ptw.de.PTW100.Xamarin.Android.dll 5> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. 6>Starting deployment to 10.1" Marshmallow (6.0.0) XHDPI Tablet ... 6>Starting emulator 10.1" Marshmallow (6.0.0) XHDPI Tablet ... 6>Validating emulator arguments... 6>Determining if emulator is already running... 6>Emulator is already running. ========== Build: 5 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== ` and F5: `Starting runtime checks Starting emulator 10.1" Marshmallow (6.0.0) XHDPI Tablet ...1>Waiting for runtime checks to complete Build completed in 00:01:11.797 Validating emulator arguments... Determining if emulator is already running... Emulator is already running. Runtime checks completed Build has been canceled.` In the VS status bar is then "Deploy Canceled".
-
0
uninstall the existing application on the emulator (if exists) close visual studio delete all bin & obj files (you have a bat file for it in solution root folder) retry. if not works, create a new emulator with the latest SDK
-
0
OK, what the heck, I guess it is worth a try. I started the LogCat on my Android and I noticed that the AspNetZero App was crashing after attempting some ClientUser interaction of some sort. The stack-trace information was not very precise, but showed that the application was crashing.
if not works, create a new emulator with the latest SDK What do you mean by this. Create emulator? I use the emulators that are available from Xamarin, I don't create them as far as I can see.
I'll let you know, of course, if I find a solution. I am also suspecting the Visual Studio-2017-next Preview edition. It should not be the probelm, but... Thanks again.
-
0
OK, progress after the delete/rebuild:
I can deploy with the VS-debugger to a real Android 7 SDK24 phone. The App now gives me a reasonable error message:
I is attempting to call:
GET http://192.168.2.107:22742/AbpUserConfiguration/GetAll => Call Failed.
Well, as far as I can see (test, code search) , this API does not exist in the star.Web.Host
Does it?
Then upon "continue from dialog" it crashes here:
09-26 20:28:32.980 E/mono-rt (27469): [ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Set configuration before using remote localization! NOTE: This is at line 42 in Mobile.Shared ...Localization.L.cs
NOTE Below in stack trace that the connection with the server is established: 09-26 20:27:50.567 D/ (27469): [Posix_connect Debug]Process com.ptw.de.PTW100.Mobile :22742
Perhaps you need to test/check again since there have been recent breaking changes in androids 8 SDKs.
Stack trace from Debugger deploy to real android 7 phone:
Thread started: #58 09-26 20:23:53.216 D/WindowClient(27469): Add to mViews: DecorView@6c4a89b[], this = android.view.WindowManagerGlobal@4f60494 09-26 20:23:53.222 D/OpenGLRenderer(27469): CanvasContext() 0x88a47000 09-26 20:23:53.223 D/ViewRootImplSplashActivity: hardware acceleration is enabled, this = ViewRoot{a711662 com.ptw.de.PTW100.Mobile/md549fab4cb238a8c0da1e7c7324330196b.SplashActivity,ident = 2} 09-26 20:23:53.271 D/Surface (27469): Surface::allocateBuffers(this=0x88d09100) 09-26 20:23:53.271 D/OpenGLRenderer(27469): CanvasContext() 0x88a47000 initialize window=0x88d09100, title=com.ptw.de.PTW100.Mobile/md549fab4cb238a8c0da1e7c7324330196b.SplashActivity 09-26 20:23:53.271 D/Surface (27469): Surface::connect(this=0x88d09100,api=1) 09-26 20:23:53.276 W/libEGL (27469): [ANDROID_RECORDABLE] format: 1 09-26 20:23:53.284 D/Surface (27469): Surface::setBufferCount(this=0x88d09100,bufferCount=4) 09-26 20:23:53.327 D/GraphicBuffer(27469): register, handle(0xa0b86ea0) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:23:53.355 D/GraphicBuffer(27469): register, handle(0xa0b87370) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:23:54.879 D/GraphicBuffer(27469): register, handle(0xa0b873e0) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:23:54.902 D/GraphicBuffer(27469): register, handle(0xa0b87450) (w:811 h:643 s:816 f:0x1 u:0x000f02) Thread finished: <Thread Pool> #55 Thread started: <Thread Pool> #59 Thread started: <Thread Pool> #60 The thread 0x37 has exited with code 0 (0x0). Thread finished: <Thread Pool> #60 The thread 0x3c has exited with code 0 (0x0). Thread finished: <Thread Pool> #57 Thread started: <Thread Pool> #61 The thread 0x39 has exited with code 0 (0x0). Thread finished: #58 The thread 0x3a has exited with code 0 (0x0). Thread finished: <Thread Pool> #59 Thread started: <Thread Pool> #62 Thread started: <Thread Pool> #63 The thread 0x3b has exited with code 0 (0x0). Thread finished: <Thread Pool> #61 The thread 0x3d has exited with code 0 (0x0). Thread started: <Thread Pool> #64 Thread finished: <Thread Pool> #63 The thread 0x3f has exited with code 0 (0x0). Thread finished: <Thread Pool> #62 Thread started: <Thread Pool> #65 Thread started: <Thread Pool> #66 The thread 0x3e has exited with code 0 (0x0). Thread finished: <Thread Pool> #65 The thread 0x41 has exited with code 0 (0x0). Thread finished: <Thread Pool> #64 Thread started: <Thread Pool> #67 The thread 0x40 has exited with code 0 (0x0). Thread finished: <Thread Pool> #66 Thread started: <Thread Pool> #68 Thread started: <Thread Pool> #69 The thread 0x42 has exited with code 0 (0x0). Thread finished: <Thread Pool> #68 The thread 0x44 has exited with code 0 (0x0). 09-26 20:27:50.567 I/System.out(27469): [socket][2] connection /192.168.2.107:22742;LocalPort=-1(0) 09-26 20:27:50.567 D/ (27469): [Posix_connect Debug]Process com.ptw.de.PTW100.Mobile :22742 09-26 20:27:50.568 D/Surface (27469): Surface::disconnect(this=0x88d09100,api=1) 09-26 20:27:50.569 D/GraphicBuffer(27469): unregister, handle(0xa0b87450) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:27:50.570 D/GraphicBuffer(27469): unregister, handle(0xa0b873e0) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:27:50.571 D/GraphicBuffer(27469): unregister, handle(0xa0b87370) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:27:50.572 D/GraphicBuffer(27469): unregister, handle(0xa0b86ea0) (w:811 h:643 s:816 f:0x1 u:0x000f02) 09-26 20:27:50.581 I/System.out(27469): [socket][/192.168.2.104:46771] connected 09-26 20:27:50.608 D/WindowClient(27469): Remove from mViews: DecorView@6c4a89b[], this = android.view.WindowManagerGlobal@4f60494 09-26 20:27:50.609 V/InputMethodManager(27469): onWindowFocus: null softInputMode=32 first=false flags=#81810500 Thread finished: <Thread Pool> #67 Thread started: <Thread Pool> #70 The thread 0x43 has exited with code 0 (0x0). Thread started: #71 09-26 20:28:03.641 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.641 D/Mono (27469): Searching for 'java_interop_jnienv_call_int_method'. 09-26 20:28:03.641 D/Mono (27469): Probing 'java_interop_jnienv_call_int_method'. 09-26 20:28:03.641 D/Mono (27469): Found as 'java_interop_jnienv_call_int_method'. 09-26 20:28:03.715 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.715 D/Mono (27469): Searching for 'java_interop_jnienv_call_boolean_method'. 09-26 20:28:03.715 D/Mono (27469): Probing 'java_interop_jnienv_call_boolean_method'. 09-26 20:28:03.715 D/Mono (27469): Found as 'java_interop_jnienv_call_boolean_method'. 09-26 20:28:03.846 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.846 D/Mono (27469): Searching for 'java_interop_jnienv_new_byte_array'. 09-26 20:28:03.846 D/Mono (27469): Probing 'java_interop_jnienv_new_byte_array'. 09-26 20:28:03.846 D/Mono (27469): Found as 'java_interop_jnienv_new_byte_array'. Thread started: <Thread Pool> #72 09-26 20:28:03.873 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.873 D/Mono (27469): Searching for 'java_interop_jnienv_set_byte_array_region'. 09-26 20:28:03.873 D/Mono (27469): Probing 'java_interop_jnienv_set_byte_array_region'. 09-26 20:28:03.873 D/Mono (27469): Found as 'java_interop_jnienv_set_byte_array_region'. 09-26 20:28:03.878 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.878 D/Mono (27469): Searching for 'java_interop_jnienv_call_int_method_a'. 09-26 20:28:03.878 D/Mono (27469): Probing 'java_interop_jnienv_call_int_method_a'. 09-26 20:28:03.878 D/Mono (27469): Found as 'java_interop_jnienv_call_int_method_a'. Thread started: <Thread Pool> #73 09-26 20:28:03.912 D/Mono (27469): DllImport searching in: '__Internal' ('(null)'). 09-26 20:28:03.912 D/Mono (27469): Searching for 'java_interop_jnienv_get_byte_array_region'. 09-26 20:28:03.912 D/Mono (27469): Probing 'java_interop_jnienv_get_byte_array_region'. 09-26 20:28:03.912 D/Mono (27469): Found as 'java_interop_jnienv_get_byte_array_region'. 09-26 20:28:04.207 D/Mono (27469): Image addref System.Numerics[0x878ccc80] -> System.Numerics.dll[0x87840800]: 2 09-26 20:28:04.207 D/Mono (27469): Prepared to set up assembly 'System.Numerics' (System.Numerics.dll) 09-26 20:28:04.207 D/Mono (27469): Assembly System.Numerics[0x878ccc80] added to domain RootDomain, ref_count=1 09-26 20:28:04.211 D/Mono (27469): AOT: image 'System.Numerics.dll.so' not found: dlopen failed: library "/data/app/com.ptw.de.PTW100.Mobile-1/lib/arm/libaot-System.Numerics.dll.so" not found 09-26 20:28:04.213 D/Mono (27469): AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/lib/mono/aot-cache/arm/System.Numerics.dll.so' not found: dlopen failed: library "/data/app/com.ptw.de.PTW100.Mobile-1/lib/arm/libaot-System.Numerics.dll.so" not found 09-26 20:28:04.214 D/Mono (27469): Config attempting to parse: 'System.Numerics.dll.config'. 09-26 20:28:04.214 D/Mono (27469): Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/etc/mono/assemblies/System.Numerics/System.Numerics.config'. Loaded assembly: System.Numerics.dll [External]09-26 20:28:04.214 D/Mono (27469): Assembly Ref addref netstandard[0x8a278680] -> System.Numerics[0x878ccc80]: 2
09-26 20:28:04.215 D/Mono (27469): Assembly Ref addref System.Numerics[0x878ccc80] -> mscorlib[0x9c195080]: 58 09-26 20:28:04.501 D/Mono (27469): Assembly Ref addref netstandard[0x8a278680] -> System.Runtime.Serialization[0x89bb9460]: 3 09-26 20:28:04.542 D/Mono (27469): Image addref System.Data[0x878ccf80] -> System.Data.dll[0x878b3c00]: 2 09-26 20:28:04.545 D/Mono (27469): Prepared to set up assembly 'System.Data' (System.Data.dll) 09-26 20:28:04.545 D/Mono (27469): Assembly System.Data[0x878ccf80] added to domain RootDomain, ref_count=1 09-26 20:28:04.548 D/Mono (27469): AOT: image 'System.Data.dll.so' not found: dlopen failed: library "/data/app/com.ptw.de.PTW100.Mobile-1/lib/arm/libaot-System.Data.dll.so" not found 09-26 20:28:04.550 D/Mono (27469): AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/lib/mono/aot-cache/arm/System.Data.dll.so' not found: dlopen failed: library "/data/app/com.ptw.de.PTW100.Mobile-1/lib/arm/libaot-System.Data.dll.so" not found 09-26 20:28:04.550 D/Mono (27469): Config attempting to parse: 'System.Data.dll.config'. 09-26 20:28:04.550 D/Mono (27469): Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/etc/mono/assemblies/System.Data/System.Data.config'. 09-26 20:28:04.550 D/Mono (27469): Assembly Ref addref netstandard[0x8a278680] -> System.Data[0x878ccf80]: 2 09-26 20:28:04.553 D/Mono (27469): Assembly Ref addref System.Data[0x878ccf80] -> mscorlib[0x9c195080]: 59 09-26 20:28:04.553 D/Mono (27469): Assembly Ref addref System.Data[0x878ccf80] -> System.Xml[0x8a278ce0]: 3 Loaded assembly: System.Data.dll [External] 09-26 20:28:04.569 D/Mono (27469): Assembly Ref addref System.Data[0x878ccf80] -> System[0x8a278bc0]: 13 09-26 20:28:04.573 D/Mono (27469): Assembly Ref addref System.Data[0x878ccf80] -> System.Core[0x8a2779c0]: 9 Unhandled Exception:
System.Exception: <Timeout exceeded getting exception details>
09-26 20:28:29.598 D/Mono (27469): DllImport attempting to load: '/system/lib/liblog.so'. 09-26 20:28:29.602 D/Mono (27469): DllImport loaded library '/system/lib/liblog.so'. 09-26 20:28:29.602 D/Mono (27469): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so'). 09-26 20:28:29.602 D/Mono (27469): Searching for '__android_log_print'. 09-26 20:28:29.602 D/Mono (27469): Probing '__android_log_print'. 09-26 20:28:29.602 D/Mono (27469): Found as '__android_log_print'. 09-26 20:28:29.622 I/MonoDroid(27469): UNHANDLED EXCEPTION: 09-26 20:28:29.697 I/MonoDroid(27469): System.Exception: Set configuration before using remote localization! 09-26 20:28:29.697 I/MonoDroid(27469): at ptw.de.PTW100.Localization.L.LocalizeInternal (System.String text) [0x0003b] in C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\Localization\L.cs:45 09-26 20:28:29.697 I/MonoDroid(27469): at ptw.de.PTW100.Localization.L.Localize (System.String text) [0x00001] in C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\Localization\L.cs:13 09-26 20:28:29.697 I/MonoDroid(27469): at ptw.de.PTW100.Core.Threading.AbpExceptionHandler+<HandleIfAbpResponseAsync>d__0.MoveNext () [0x00102] in C:\Users\Hubert\source\repos\SRI\PTW100\src\ptw.de.PTW100.Mobile.Shared\Core\Threading\AbpExceptionHandler.cs:34 09-26 20:28:29.697 I/MonoDroid(27469): --- End of stack trace from previous location where exception was thrown ---
-
0
(Good to hear it shows a user friendly error message. so I guess the problem was old bin & obj files.)
Debugging & Connecting to Xamarin App
To connect from Xamarin app to the host; you can try several tests
- Try to open the URL in your development computer's browser
http://192.168.2.107:22742/AbpUserConfiguration/GetAll
- Try to open the same URL in your phone.
- Never use your mobile's data connection, to be able to debug from your android device, your android mobile phone must be in the same WiFi (turn off the data network and enable the WiFi)
- Do not start Web.Mvc or Web.Host project via Visual Studio. Default settings of Visual Studio does not allow external connections. For more info you can read External Network Access to Kestrel and IIS Express in ASP.NET Core
The related docs are Xamarin Development Guide and Developing Step By Step Xamarin.
- Try to open the URL in your development computer's browser
-
0
Thanks alper for the great infos! I am one step ahead of you though. I did everything you suggested already before I wrote :-) You can also see in the logs and in the stack above that the mobile client is indeed making the connection with the host. It is apparently not a connection problem. That is why I answered that
http://192.168.2.107:22742/AbpUserConfiguration/GetAll
cannot be found. I cannot call this from anywhere.
Question: Where can I set a debug point to see this entrypoing in the Web.Host?Also, as you noted, when I test the Web.Host using VStudio, the default route does not work:
http://localhost:22742/
gives me the message "unable to handle this request".
http://localhost:22742/swagger works fine.
I can surely find and fix this myself, but I am using the UNCHANGED base code from ASP.NETZero: I have not made any changes. So why isn't the default route working? Ideas?
Question: I assume that the default route http://localhost:22742/ should simply to the HomeController in Web.Host.
Thanks again!
-
0
it's not related with the code base. As I stated, don't run Web.Host via Visual Studio. make a new batch file with the below contents and run that for starting Web.Host.
CD /D "C:\MyProject.Web.Host" SET ASPNETCORE_ENVIRONMENT=Development SET ASPNETCORE_URLS=http://*:22742 dotnet run
-
0
Thanks alper. Yes, see my first post. This is precisely what I did. That is not the problem. Also above, you can see in the log/stack that the connection is working fine.
The problem, I think, is that it is not finding the following route -- and I don't see it in the code either:
http://192.168.2.107:22742/AbpUserConfiguration/GetAll
So my questions above are still the same. Can you help me out with them? THANKS!
-
0
Hi,
I guess you are using Merged version of the project.
So for your last question, http://localhost:22742/ doesn't navigate to HomeController (this is disabled by default) Try opening http://localhost:22742/AbpUserConfiguration/GetAll/ You should see some Json response
See my working log output. A request is being made to
http://192.168.1.38:22742/AbpUserConfiguration/GetAll
And route matched with {action = "GetAll", controller = "AbpUserConfiguration", area = ""}.INFO 2018-09-26 12:44:07,333 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://192.168.1.38:22742/AbpUserConfiguration/GetAll INFO 2018-09-26 12:44:07,334 [9 ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token. INFO 2018-09-26 12:44:07,355 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetAll", controller = "AbpUserConfiguration", area = ""}. Executing action Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) INFO 2018-09-26 12:44:07,359 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) - Validation state: Valid INFO 2018-09-26 12:44:08,580 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore), returned result Microsoft.AspNetCore.Mvc.JsonResult in 1220.9227ms. INFO 2018-09-26 12:44:08,643 [20 ] matters.Json.Internal.JsonResultExecutor - Executing JsonResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2018-09-26 12:44:08,701 [20 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) in 1345.4365ms INFO 2018-09-26 12:44:08,701 [20 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1368.5447ms 200 application/json; charset=utf-8
-
0
Hi alper. Many thanks. This helps. I am indeed NOT getting that response. I'll investigate and get back to you here...
From your log above:
INFO 2018-09-26 12:44:07,334 [9 ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token. I'm thinking that this may be where the problem is in my case. How does the mobile client get a valid token without logging in first? Hmmm.
-
0
-
0
Hi,
Alper will help you with the latest problem about Configuration being null.
For this one;
I'm thinking that this may be where the problem is in my case. How does the mobile client get a valid token without logging in first? Hmmm.
When you authenticate once, the token is stored in the app and it is used for the next time. So, there might be something left in the app from an older request.
-
0
Thanks! But how can I authenticate the app when it never starts? I never get a chance to authenticate, since the app never gets past the init screen before it crashes. Have deleted all bin/obj and created new android emulators, so a "stale cache" cannot be the problem.
Thanks for any tips!
-
0
your problem is still connecting to the Host. When I check your exception stack I see
HandleFlurlHttpException
the highlighted line you captured is trying to translate the text "Error" but as the app couldn't get the translation Json it throws exception. So what you need to do is,UserConfigurationManager.cs
orWebRequestExecuter.cs
. It's definately connection issue! -
0
Thanks alper. It was not a communication error. It works fine if I use .Web.Mvc as the target instead of Web.Host. I have been using host the whole time, since that is what it says to use in the documentations. All of this above, and always using Web.Host. The APIs it was failing on are not available on Web.Hos, so the connection was made, and then the API not found which responded with internalServerError...
Thanks again for your help. Moving on.
-
0
Dear alper, OK, this may be another problem, but do you have any idea where these port numbers are comming from (see screen shot). I have not changed anything in the mobile app, and the user-login connections are now failing due to ports that do not exist. A search through all files did not lead to any clues. THANKS
-
0
this is where the Xamarin gets the Host URL https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application.Client/ApiClient/ApiUrlConfig.cs#L8
-
0
Thanks Alper,
Yes. I have not modified that file, and the admin GUI on the mobile works fine, where I can also define a tenant and a user. But as soon as I try to login as that user, I get the error above. There is some funky manipulation of ports going on somewhere in the original source code (no mods by us), and it doesn't work :-)
-
0
the URL can change on the fly within this method.
Put a breakpoint to see if your tenant has a different base URL.
-
0
Hi @richardghubert,
Did you make any progress ?
-
0
Thanks. Yes, I'll put a breakpoint and debug this when I can ... this is a POC I wanted to get working, but not top prio with aspnetzero here at the moment so can't say. Thanks again.