question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: /node_modules/@capacitor/app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java:13: error: package com.getcapacitor.annotation does not exist import com.getcapacitor.annotation.CapacitorPlugin; ^

See original GitHub issue

Bug Report

I can’t build app , android studio report this :

/node_modules/@capacitor/app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java:13: error: package com.getcapacitor.annotation does not exist import com.getcapacitor.annotation.CapacitorPlugin; ^

Capacitor Version

npx cap doctor
💊   Capacitor Doctor  💊

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 3.0.0-beta.1
  @capacitor/core: 3.0.0-beta.1
  @capacitor/android: 2.4.6

[success] Android looking great! 👌

Platform(s)

android

Current Behavior

/node_modules/@capacitor/app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java:13: error: package com.getcapacitor.annotation does not exist import com.getcapacitor.annotation.CapacitorPlugin;

Other Technical Details

npm --version output: 6.13.4

node --version output: v12.16.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, Apr 26, 2021

All the plugins with the @capacitor scope in the name are Capacitor 3 plugins, so you have to use Capacitor 3.

If you don’t want to move to Capacitor 3 yet, then don’t use the plugins with @capacitor scope, they were already included in Capacitor 2 without installing anything extra.

1reaction
jcesarmobilecommented, Feb 8, 2021

To use the new plugins you also need to use capacitor/android beta, but you are using 2.4.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: package com.getcapacitor.annotation does not exist ...
Bug Report. After installing the BrowserPlugin and Clipboard plugins during the build, I get an error. node_modules\@capacitor\browser\android\ ...
Read more >
Error: package com.getcapacitor.annotation does not exist
Hi to all. I've several problems with plugins and new capacitor 3. For instance the new sqlite: capacitor-community/ sqlite My configuration ...
Read more >
angular - Error after upgrading to Capacitor v3 package com ...
My angular ionic application was working fine on Android ...
Read more >
Capacitor Android Plugin Guide
A Capacitor plugin for Android is a simple Java class that extends com.getcapacitor.Plugin and has a @CapacitorPlugin() annotation. It has some methods with ......
Read more >
Writing a native Ionic plugin for Capacitor in less than 30 ...
There are three main steps to writing a plugin: ... PluginMethod; import com.getcapacitor.annotation.CapacitorPlugin; @CapacitorPlugin(name ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found