Android Question Permission Denial on Starting Intent when deploying app for the first time with b4a8.0

leitor79

Active Member
Licensed User
Longtime User
Hi,

I've opened a project for the first time with B4A8.0, updated the sdktarget to 26 and jar reference, and I'm getting an exception when I deploy the app on a virtual 8.0 android device.

I've been reading and I'm aware that I probably need to perform some changes on the permissions, but I read here and I don't get where I should make the change.

My app is based on this one and the starting intent is set up in the manifest file. Also, I didin't find which permission should I ask for.

Thank you very much!

B4A Version: 8.00
Parsing code. (0.12s)
Running custom action. (0.18s)
Compiling code. (0.34s)
Compiling layouts code. (0.01s)
Organizing libraries. (1.76s)
Generating R file. (1.57s)
Compiling generated Java code. (6.63s)
Convert byte code - optimized dex. (2.68s)
Packaging files. (1.95s)
Copying libraries resources (0.06s)
Found 3 resource files.
Signing package file (debug key). (1.43s)
ZipAlign file. (0.28s)
Installing file to device. Error
Security exception: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=mypackage.myapp/.main } from null (pid=5354, uid=2000) not exported from uid 10083
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=mypackage.myapp/.main } from null (pid=5354, uid=2000) not exported from uid 10083
at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1624)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:434)
at com.android.server.am.ActivityStarter.startActivityLocked(ActivityStarter.java:273)
at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:827)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4497)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:410)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:141)
at android.os.ShellCommand.exec(ShellCommand.java:96)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:14889)
at android.os.Binder.shellCommand(Binder.java:573)
at android.os.Binder.onTransact(Binder.java:473)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4256)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2935)
at android.os.Binder.execTransact(Binder.java:674)
 

Pendrush

Well-Known Member
Licensed User
Longtime User
I get same exception on few project started first time on 8.1 device with b4a v8.0.
Some have dangerous permission, some don't.
 
Upvote 0

leitor79

Active Member
Licensed User
Longtime User
Hi! Thanks for the answer.

No, I think I don't have any permissions set?

If the permissions are set only with AddPermision within the manifest file, then I have none.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
First double check the permissions list (click on the button) on the right hand logs tab, then add any permissions in the manifest file in the list and at the start of your activity code. You should watch the video again and read the link extremely carefully...
 
Upvote 0

leitor79

Active Member
Licensed User
Longtime User
Hi Peter, thank you for your answer.

I've checked where you way and I've found 2 permissions.

I've added them in the manifest file, but the error is still the same.

I've tried to add the permissions request in the activity_create, but:

1) Internet and Wake_Lock are not listed as enum items in the runtimepermissions object.
2) My app starts as a service


Regards!
.png
 
Upvote 0

leitor79

Active Member
Licensed User
Longtime User
Hi Erel, thanks again for your answer.

I didn't noticed that the "picture" at the top was a video. I've watched it now. However, in spite of learning a few things, I still don't get how my issue is related to any of that.

- The only dangerous permission was removed in the manifest. I don't remember why I put that there, but if I remove that permission-removal it doesn't appear in the permissions box. Also, I've noticed that my app doesn't request the use of write on the external storage. I'm not using dirrootexternal or something like that.

- I've added the other 2 non-dangerous permissions into the manifest.

- So, I understand that if I don't need dangerous permissions into my app, I don't need to check and request for them (my understanding of spoken english is not that good). Then, as my app is not using them, I don't have to use checkandrequest (nor check in the service module).

- I've read the list of dangerous permissions and I don't realize, if it's a missing permission, which dangerous permission is related to starting services.


Regards,



.png .png


B4A Version: 8.00
Parsing code. (0.08s)
Running custom action. (0.20s)
Compiling code. (0.51s)
Compiling layouts code. (0.03s)
Organizing libraries. (2.08s)
Generating R file. (2.40s)
Compiling generated Java code. (5.50s)
Convert byte code - optimized dex. (2.90s)
Packaging files. (1.65s)
Copying libraries resources (0.02s)
Found 3 resource files.
Signing package file (debug key). (1.38s)
ZipAlign file. (0.34s)
Installing file to device. Error
Security exception: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=myPackage.myApp/.main } from null (pid=13412, uid=2000) not exported from uid 10084
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=myPackage.myApp/.main } from null (pid=13412, uid=2000) not exported from uid 10084
at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1624)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:434)
at com.android.server.am.ActivityStarter.startActivityLocked(ActivityStarter.java:273)
at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:827)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4497)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:410)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:141)
at android.os.ShellCommand.exec(ShellCommand.java:96)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:14889)
at android.os.Binder.shellCommand(Binder.java:573)
at android.os.Binder.onTransact(Binder.java:473)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4256)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2935)
at android.os.Binder.execTransact(Binder.java:674)
 
Upvote 0
Top