Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with RequiresPermission dependency in Capacitor 3 #957

Closed
sdunnin opened this issue Mar 20, 2023 · 3 comments
Closed

Problem with RequiresPermission dependency in Capacitor 3 #957

sdunnin opened this issue Mar 20, 2023 · 3 comments

Comments

@sdunnin
Copy link

sdunnin commented Mar 20, 2023

I am using the ble-central plugin in a Capacitor application. After upgrading from 1.4.x. to latest 1.6.3 when building the app in Android Studio it complained about not being able to resolve androidx.annotation.RequiresPermission which was a result of a missing dependency implementation "androidx.annotation:annotation:1.1.0" in build.gradle. Adding the dep then made the project build successfully.

Problem was that whenever a Capacitor Update cli command was run the generated build.gradle would be overwritten. To solve the issue I hacked the following into plugin.xml for my installed version of the plugin which the Capacitor cli subsequently adds the dependency into build.gradle.

<framework src="androidx.annotation:annotation:1.1.0"/>

I'm guessing this is probably more of a Capacitor tooling issue as I'm not really sure how this would be handled in other frameworks that utilize ble-central. Wanted to at least document this for others that may come across this issue using the plugin.

@peitschie
Copy link
Collaborator

@sdunnin thanks for sharing! What version of capacitor are you working with? I might see if the above tweak has any ill-effects with any other configurations... it may be worth just doing, otherwise.

@sdunnin
Copy link
Author

sdunnin commented Mar 21, 2023

We are using Capacitor 3.3

@peitschie peitschie changed the title Problem with RequiresPermission dependency in Capacitor Problem with RequiresPermission dependency in Capacitor 3 Mar 21, 2023
@peitschie
Copy link
Collaborator

I'll close this as Capacitor 5 has just been released. If there's significant interest in this however, please re-open and I can have a look at addressing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants