apptreesoftware / flutter_google_map_view

A flutter plugin for Google Maps
MIT License
416 stars 189 forks source link

Security exception: Permission Denial: starting Intent #120

Closed dark-chocolate closed 6 years ago

dark-chocolate commented 6 years ago

Recently I updated my Flutter to 0.7.3 (beta-channel) and now I am getting the following error.

Finished with error: Exit code 255 from: /Users/userName/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true com.example.demoapp/com.apptreesoftware.mapview.MapActivity:
Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.demoapp/com.apptreesoftware.mapview.MapActivity (has extras) }

Security exception: Permission Denial: starting Intent { act=android.intent.action.RUN flg=0x30000000 cmp=com.example.demoapp/com.apptreesoftware.mapview.MapActivity (has extras) } from null (pid=6886, uid=2000) not exported from uid 10085

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.RUN flg=0x30000000 cmp=com.example.demoapp/com.apptreesoftware.mapview.MapActivity (has extras) } from null (pid=6886, uid=2000) not exported from uid 10085
    at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1788)
    at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:717)
    at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:544)
    at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1099)
    at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:486)
    at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:5120)
    at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:5094)
    at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:479)
    at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:161)
    at android.os.ShellCommand.exec(ShellCommand.java:103)
    at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16005)
    at android.os.Binder.shellCommand(Binder.java:634)
    at android.os.Binder.onTransact(Binder.java:532)
    at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3592)
    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3291)
    at android.os.Binder.execTransact(Binder.java:731)

However if I run the app natively by going in Android Studio (java) then the app successfully runs.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.14 18A314h, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.0)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.
dark-chocolate commented 6 years ago

Actually, we need to place the com.apptreesoftware.mapview.MapActivity below our MainActivity in the AndroidManifest.xml file. The solution might sound weird but it works.