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.

Dialog not showing

See original GitHub issue

Hi,

the dialog isn’t showing for me. The api of my app is 14 and the device which I’m trying on is on Android 6.0 version. I’m trying to get CAMERA permission for example. I have modified the plugin by adding another permission: private String[] getPermissions(JSONArray permissions) { String[] stringArray = new String[permissions.length() + 1]; for (int i = 0; i < permissions.length(); i++) { try { stringArray[i] = permissions.getString(i); } catch (JSONException ignored) { //Believe exception only occurs when adding duplicate keys, so just ignore it } } stringArray[1] = Manifest.permission.READ_EXTERNAL_STORAGE; return stringArray; }

and this works: I can see both permission dialogs showing up.

If I hardcode this permission it does the job as well:

private String[] getPermissions(JSONArray permissions) { String[] stringArray = new String[permissions.length()]; for (int i = 0; i < permissions.length(); i++) { try { stringArray[i] = Manifest.permission.READ_EXTERNAL_STORAGE; } catch (JSONException ignored) { //Believe exception only occurs when adding duplicate keys, so just ignore it } } return stringArray; }

Hardcoding the Manifest.permission.CAMERA wouldn’t work.In that scenario though.

Any ideas? I’m still confused why it wouldn’t work on some scenarios and it would on others. Without tweaking the plugin I couldn’t get it to work on any permission I requested.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mlshvcommented, Nov 21, 2017

Had the same problem. Forgot to add video permission to Android Manifest after platfrom remove, platform add. Everyone having the same issue, double-check your AndroidManifest.xml, it should contain either one or both of these

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
0reactions
dcroussetcommented, Oct 18, 2022

Had the same problem. Ended by adding this in my config.xml (cordova 9+) :

...
<platform name="android">
    <config-file target="AndroidManifest.xml" parent="/manifest">
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    </config-file>
    ...
</platform>
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dialog does not appear - Stack Overflow
I was running the code to show the AlertDialog on a non-ui thread. After using: runOnUiThread(new Runnable() { @Override public void run() {...
Read more >
Windows 10 Dialog box not displaying correctly
Hi, I believe I have a slight problem with Windows 10 dialog boxes not displaying correctly. The information if displayed is bunched up...
Read more >
Dialog box windows are not displayed in AutoCAD products
Solution: · Use the keyboard to move the window into view. Try this first on a visible window to see how it works:...
Read more >
Client: Dialog box window does not appear (is hidden) and ...
Client: Dialog box window does not appear (is hidden) and window may go gray · Click the Windows Start button, and then Control...
Read more >
A dialog box does not appear to be opening?
Sometimes a dialog box may appear to not open on your screen. This can sometimes be caused by the dialog box opening off...
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