Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Android 10 runtime permission problem in sample code
Started by sam149 Sep 11 2019 06:39 PM

9 replies to this topic
android 10 runtime permission

Best Answer vlads , 20 November 2019 - 02:56 PM

Sorry it took so long. Next daily build should fix this issue (2019.3552)

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 20 posts
  • Corona SDK

Corona Version 2019.3523

Android device:  Google Pixel 2 (Android 10)

 

Compile sample project "Camera" from Corona simulator to generate the apk.

Then download the apk to device for running. When trigger the camera function, following error coming out from the screen:

 

 

 

09-12 10:24:08.708 18690 18714 I Corona  : Lacking camera permission!

09-12 10:24:08.710 18690 18690 I Corona  : ERROR: Camera tried to request access to a permission group without having any permissions from that group in build.settings/AndroidManifest.xml!

09-12 10:24:08.710 18690 18690 I Corona  :

09-12 10:24:08.710 18690 18690 I Corona  : Before requesting access, please add a permission from the android.permission-group.CAMERA permission group!

 

The same apk can be runned in Google Pixel 2 (Android 9), but not Android 10.

Attached Files



[TOPIC: post.html]
#2

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 20 posts
  • Corona SDK

Hi Corona teams,

 

Is there any update which can fix this problem in Android 10?



[TOPIC: post.html]
#3

RedPistonEB

[GLOBAL: userInfoPane.html]
RedPistonEB
  • Enthusiast

  • 31 posts
  • Corona SDK

Running into the same issue with Corona Native. I set the usesPermission in build.settings, but still get the warning. Anyone?



[TOPIC: post.html]
#4

RedPistonEB

[GLOBAL: userInfoPane.html]
RedPistonEB
  • Enthusiast

  • 31 posts
  • Corona SDK

At least for me, the usesPermission strings are not getting copied over from build.settings to the androidmanifest. Was this maybe a bug introduced in a daily build?



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,614 posts
  • Enterprise

I would suggest that you look at the sample apps that we ship with Corona in SampleCode/Media/Camera is the example code for requesting permissions.

 

Rob



[TOPIC: post.html]
#6

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 20 posts
  • Corona SDK

Hi Rob,

 

Can you confirm the example code is working at Android 10 device? 

If yes, then I will solve this problem by myself.

 

 

P.S.  I already tried the example code,  the apk file generated by example code is only  working at Android 9 or below device , but it will prompt the error in Android 10.



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,614 posts
  • Enterprise

We will look into it.

 

Rob



[TOPIC: post.html]
#8

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Corona Geek

  • 1,031 posts
  • Corona Staff

  Best Answer

Sorry it took so long. Next daily build should fix this issue (2019.3552)



[TOPIC: post.html]
#9

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 20 posts
  • Corona SDK

Sorry it took so long. Next daily build should fix this issue (2019.3552)

Yes, this build solve Android 10 issue in when compiling the android app through Corona simulator.

But the latest version cause error in latest Android native build through Android studio.

Please see my post in

https://forums.coronalabs.com/topic/76700-corona-3552-project-templates-app-android-build-error-missing-licensing-googlejar/



[TOPIC: post.html]
#10

RedPistonEB

[GLOBAL: userInfoPane.html]
RedPistonEB
  • Enthusiast

  • 31 posts
  • Corona SDK

Sam149,

 

I looked into it further and figured out that build.settings uses permissions no longer get processed and put into the manifest for Native. I had to manually add them. This was not the case before, but they must have made some changes recently and the documents support this. This was my issue Rob, thanks.

 

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

  • For Corona Native builds on Android, the build.settings file is ignored entirely




[topic_controls]
[/topic_controls]