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.

Android application in Release requires permission whereas Debug does not

See original GitHub issue

Description

Although internet connectivity check is used, resources on the internet cannot be accessed when in Release build on android. Works fine with the exact same code built and run on Android Debug and Windows Release and Windows Debug configurations.

Example:

  • for a DB call, SqlException class 20 is received which normally occurs in EF Core when internet connectivity is not available
  • when using a HttpClient to download sample HTML from google.com it outputs: System.AggregateException System.Net.WebException One or more errors occurred. (Permission denied (missing INTERNET permission?))

I cannot see output details because of Android application is running (debug is disabled in android project properties).

Are permissions bypassed on Android in Debug configuration? P.S. What would, please, be the preferred and clean way to acquire permissions in RC 2 for MAUI in general and also for MAUI Blazor - e.g. access camera from BlazorWebView? Is there any general cross-platform way or do permissions really have to be declared in Android-specific classes and files in the project?

Steps to Reproduce

  • MAUI Blazor app run on Android in Release build configuration
  • access the internet

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 (API 30)

Did you find any workaround?

no, I cannot install Debug build on clients’ phones

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesmontemagnocommented, Apr 28, 2022

Yes, this is the same as with xamarin android and .net 6 android… debug auto adds this as it is needed for debugging, however IMHO i think we should add it to the templates. @jonathanpeppers @Redth thoughts here… i really think this is going to bite people

0reactions
jamesmontemagnocommented, Apr 29, 2022

Agreed @jonathanpeppers and it is easy to remove (harder to miss if not there) and doesn’t hurt anything as it isn’t like that comes up in permissions or anything you know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android app debug apk does not ask for permissions on ...
On some devices, the app correctly asks permissions while sidloading. On others (Android 6.0), it does not ask permissions while sideloading at ...
Read more >
Prepare your app for release | Android Studio
Preparing for release is a required development task and is the first step in the publishing ... For more information, see Debug your...
Read more >
App works while debugging but not on release : r/flutterhelp
With the release app already installed, go to the app configuration, in the android configs, and give both permissions manually. If that's the ......
Read more >
Request runtime permissions
Check whether the user has already granted the runtime permission that your app requires. If so, your app can access the private user...
Read more >
Configure on-device developer options | Android Studio
The Settings app on Android includes a screen called Developer options where you can configure system behaviors that help you profile and debug...
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