question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpClient in AndroidApp crash again

See original GitHub issue

Description

Crash occurs when httpclient is used to access the API,No crash in previous versions。

Steps to Reproduce

use dotnet publish -f net6.0-android -c Release build apk, Then run the app on your phone If httpclient is used, it will crash and try catch will not catch errors

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android11

Did you find any workaround?

I found a strange step to solve this problem. 1, pack apk. 2, remove <uses-permission android:name="android.permission.INTERNET" /> in AndroidManifest.xml (Maybe any other setting) 3, pack apk again 4. add <uses-permission android:name="android.permission.INTERNET" /> in AndroidManifest.xml 5. pack apk again 6. if the packaged apk becomes smaller, the bug may be fixed

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
PieEatingNinjascommented, May 13, 2022

Sorry for the delay. But I can confirm that it seems to be working just fine in RC 3. No need to add <RunAOTCompilation>False</RunAOTCompilation>

1reaction
jonathanpepperscommented, May 10, 2022

@PieEatingNinjas can you try MAUI RC 3 that just shipped? dotnet/runtime 6.0.5 did not ship until today as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android HTTPClient causes app to crash
Clicking the menu item causes the app to Crash. The objects browser and dataProvider are 100% correctly declared. I test the app on...
Read more >
Resolving Native HttpClient Exceptions - Android
Hello, I'd like to ask if there is a way to catch unhandled native exceptions on android in a shared code... Because currently...
Read more >
MAUI app crashing in release but working in debug
Run the app on Android then look for MissingMethodException in logcat to find out what was linked out. Add that to your linker...
Read more >
httpResponse = httpClient.execute(httpGet); crashes the app
httpResponse = httpClient.execute(httpGet); crashes the app. app keeps on crashing Here is my code. import android.app.
Read more >
Connect to the network
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found