ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.16k stars 1.01k forks source link

[Bug]: android permissions confusing #7469

Closed sdetweil closed 5 months ago

sdetweil commented 5 months ago

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 4.6.1 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

[error] app directory is missing in android

Other API Details

Mac-mini:estimoteplugin4 sam$ node -v
v20.13.1
Mac-mini:estimoteplugin4 sam$ npm -v
10.5.2

Platforms Affected

Current Behavior

the migrating doc says this https://capacitorjs.com/docs/updating/plugins/3-0 does NOT say to add an import or anything

@CapacitorPlugin(
     name = "FooBar",
   permissions = {
       @Permission(strings = { Manifest.permission.FOO }, alias = "foo"),
       @Permission(strings = { Manifest.permission.BAR }, alias = "bar")
   })
 )  ///// <-- technically one too many close parens here

but building w kotlin source I see this

@CapacitorPlugin(name = "EstimotePlugin",
        permissions = {
            @Permission(alias = "bluetooth", strings = { Manifest.permission.BLUETOOTH_SCAN }--- ),
            @Permission(strings = { Manifest.permission.UWB_RANGING }, alias = "UWB")
        }
)

at the ---

plugins/estimoteplugin/EstimotePluginPlugin.kt:34:96 Expecting an element

flyover @Permission, get Snip20240516_9

and also says to put in the manifest file..
https://capacitorjs.com/docs/android/configuration#setting-permissions this doesn't work

Expected Behavior

one of the ways to work

Project Reproduction

https://github.com/sdetweil/estimoteplugin4

Additional Information

nothing

sdetweil commented 5 months ago

well, I finally figured it out, looking at the official plugins..

ionitron-bot[bot] commented 4 months ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.