<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Android 9 app crashes when execute await function in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747996#M9345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is your await wrapped in a try/catch?&amp;nbsp;Awaitable Tasks in the API will throw exceptions&amp;nbsp;for example for invalid parameters, or for underlying platform issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, I suspect it's because your URL is `http` rather than `https`. You can continue to use `http` in Android 9 but you will need to configure your app for that. For more information see&amp;nbsp;&lt;A href="https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted"&gt;https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jul 2019 16:14:17 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2019-07-05T16:14:17Z</dc:date>
    <item>
      <title>Android 9 app crashes when execute await function</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747995#M9344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;BR /&gt;I'am working on Visual Studio 2017 Community 15.9.13 with Xamarin 4.12.3.83 and Xamarin Android SDK 9.1.7.0.&lt;BR /&gt;I use ArcGIS runtime SDK for .NEt 100.5.0.&lt;/P&gt;&lt;P&gt;I want to compile and run the "Feature layer selection" or other similar code in the Sample Code section of the ArcGIS for Developer site.&lt;/P&gt;&lt;P&gt;When the target Android version is less then 9.0 (Pie) version, all functions well.&lt;BR /&gt;With Android 9.0 version the app is compiled and deployed correctly on my device while it&amp;nbsp;crashes when it tries to execute an await function.&lt;/P&gt;&lt;P&gt;For axample:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;Uri featureServiceUri = new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");&lt;BR /&gt;var featureTable = new ServiceFeatureTable(featureServiceUri);&lt;BR /&gt;featureLayer = new FeatureLayer(featureTable);&lt;BR /&gt;await _featureLayer.LoadAsync(); // at this point the app crashes&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When I catch the error, these are the Exception properties results:&lt;/P&gt;&lt;P&gt;***&lt;BR /&gt;HResult: -2146233088&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InnerException: Java.IO.IOException: Cleartext HTTP traffic to sampleserver6.arcgisonline.com not permitted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message: One or more errors occurred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source: mscorlib&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StackTrace: at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler+ArcGISClientHandlerInternal+&amp;lt;&amp;gt;c__DisplayClass14_1.&amp;lt;SendAsync&amp;gt;b__0 (System.Threading.Tasks.Task`1[TResult] t) [0x00033] in C:\daily_r\api_xam\dotnet\api\src\Esri.ArcGISRuntime\Esri.ArcGISRuntime.Shared\Http\ArcGISHttpClientHandler.cs:703 &lt;BR /&gt; at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in &amp;lt;d4a23bbd2f544c30a48c44dd622ce09f&amp;gt;:0 &lt;BR /&gt; at System.Threading.Tasks.Task.Execute () [0x00000] in &amp;lt;d4a23bbd2f544c30a48c44dd622ce09f&amp;gt;:0 &lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt; at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler+ArcGISClientHandlerInternal+&amp;lt;SendAsync&amp;gt;d__14.MoveNext () [0x008b5] in C:\daily_r\api_xam\dotnet\api\src\Esri.ArcGISRuntime\Esri.ArcGISRuntime.Shared\Http\ArcGISHttpClientHandler.cs:879 &lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt; at System.Net.Http.HttpClient+&amp;lt;SendAsyncWorker&amp;gt;d__49.MoveNext () [0x000&lt;BR /&gt;ca] in &amp;lt;25ebe1083eaf4329b5adfdd5bbb7aa57&amp;gt;:0 &lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt; at Esri.ArcGISRuntime.Internal.RequestRequiredHandler+&amp;lt;IssueRequestAndRespond&amp;gt;d__14.MoveNext () [0x004f9] in C:\daily_r\api_xam\dotnet\api\src\Esri.ArcGISRuntime\Esri.ArcGISRuntime.Shared\Internal\RequestRequiredHandler.cs:245 &lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt; at FeatureLayerSelectionTest.MainActivity+&amp;lt;Initialize&amp;gt;d__4.MoveNext () [0x00115] in C:\VisualStudio\Xamarin\Progetti\FeatureLayerSelectionTest\FeatureLayerSelectionTest\MainActivity.cs:82&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TargetSite: Void Throw()&lt;BR /&gt;***&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Massimo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 10:14:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747995#M9344</guid>
      <dc:creator>MassimoMazzanti</dc:creator>
      <dc:date>2019-07-05T10:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Android 9 app crashes when execute await function</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747996#M9345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is your await wrapped in a try/catch?&amp;nbsp;Awaitable Tasks in the API will throw exceptions&amp;nbsp;for example for invalid parameters, or for underlying platform issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, I suspect it's because your URL is `http` rather than `https`. You can continue to use `http` in Android 9 but you will need to configure your app for that. For more information see&amp;nbsp;&lt;A href="https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted"&gt;https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747996#M9345</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2019-07-05T16:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Android 9 app crashes when execute await function</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747997#M9346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mike,&lt;/P&gt;&lt;P&gt;I tried both with try/catch and without it, with the same result (app crash).&lt;/P&gt;&lt;P&gt;As soon as possible I will try to follow your suggestions&amp;nbsp;and inform you about the outcome of the tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Massimo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 19:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747997#M9346</guid>
      <dc:creator>MassimoMazzanti</dc:creator>
      <dc:date>2019-07-05T19:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Android 9 app crashes when execute await function</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747998#M9347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This sounds just like a bug that were in some of the first releases of VS2019: Android would crash when async methods were hit. I'm wondering if that bug also made it in to the VS2017 releases, but then never back-ported?&lt;BR /&gt;Does the app also crash there without the debugger attached? (the bug I'm thinking about didn't occur if you weren't debugging).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the issue I'm referring to:&amp;nbsp;&lt;A href="https://github.com/xamarin/xamarin-android/issues/2920"&gt;https://github.com/xamarin/xamarin-android/issues/2920&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 05:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747998#M9347</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2019-07-08T05:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Android 9 app crashes when execute await function</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747999#M9348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;following your suggestion I modified the AndroidManifest.xml file, adding the following line:&lt;BR /&gt;android: usesCleartextTraffic = "false"&lt;BR /&gt;within the &amp;lt;application&amp;gt; tag.&lt;/P&gt;&lt;P&gt;Now debug and release versions compile and run correctly under Android 9.0 and lower.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to publish the service with the https protocol, on port 6443, and the app works just as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Massimo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 11:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/android-9-app-crashes-when-execute-await-function/m-p/747999#M9348</guid>
      <dc:creator>MassimoMazzanti</dc:creator>
      <dc:date>2019-07-09T11:55:41Z</dc:date>
    </item>
  </channel>
</rss>

