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: error with capacitor plugin when loading project in android studio

See original GitHub issue

Bug Report

Capacitor Version: 1.5.0

npx cap doctor output: Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 1.5.0

@capacitor/core: 1.5.0

@capacitor/android: 1.5.0

@capacitor/ios: 1.5.0

Installed Dependencies:

@capacitor/cli 1.5.0

@capacitor/ios 1.5.0

@capacitor/core 1.5.0

@capacitor/android 1.5.0

[success] Android looking great! 👌 Found 9 Capacitor plugins for ios: capacitor-fcm (1.0.0) com.telerik.plugins.nativepagetransitions (0.6.5) cordova-plugin-fcm-with-dependecy-updated (4.1.1) cordova-plugin-device (2.0.3) cordova-plugin-ionic-keyboard (2.2.0) cordova-plugin-ionic-webview (4.1.3) cordova-plugin-splashscreen (5.0.3) cordova-plugin-statusbar (2.4.3) cordova-plugin-whitelist (1.3.4) [success] iOS looking great! 👌

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

when I want to create an apk, I get an error with capacitor-cordova-android-plugins in the android studio

npm --version output:6.13.4

node --version output: v12.8.0

pod --version output (iOS issues only): 1.8.4

Other Information

`16:13 Unsupported Modules Detected: Compilation is not supported for following modules: capacitor-cordova-android-plugins. Unfortunately you can’t have non-Gradle Java modules and Android-Gradle modules in one project.

16:13 IDE and Plugin Updates: Android Studio is ready to update.

16:13 * daemon not running; starting now at tcp:5037

16:13 * daemon started successfully

16:13 Gradle sync started with single-variant sync

16:13 Gradle sync failed: java.lang.NullPointerException (15 s 466 ms)

16:13 Android Studio is using this JDK location: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home which is different to what Gradle uses by default: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home Using different locations may spawn multiple Gradle daemons if Gradle tasks are run from command line while using Android Studio. More info… Set Android Studio to use the same JDK as Gradle and sync project Do not show this warning again

16:13 NDK Resolution Outcome: Project settings: Gradle model version=4.10.1, NDK version is UNKNOWN

16:18 Executing tasks: [clean, :capacitor-android:generateDebugSources, :app:generateDebugSources] in project /Users/luisruizfigueroa/app/adminote-movil/android

16:18 Gradle build failed in 1 s 360 ms`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
devnixcommented, May 19, 2021

closing as the workaround seems to work

This defines Ionic in one short phrase

3reactions
priyankpatcommented, Feb 25, 2020

Can you please give the following steps a try:

  • File -> Invalidate Caches / Restart -> Invalidate and Restart
  • Gradle -> Refresh Gradle Project
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Android Issues | Capacitor Documentation
This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX equivalent. You should...
Read more >
Build error in Android Studio for Ionic/Capacitor project when ...
I'm writing an application using Ionic with the intention of building it for Android and iOS. I came across an error building the...
Read more >
Troubleshoot known issues with Android Emulator
To avoid this problem, disable the microphone in the emulator by adding hw.audioInput=no to the config.ini file of the Android Virtual Device ( ......
Read more >
Firebase connect - File google-services.json is missing
bug : error with capacitor plugin when loading project in android studio. opened 07:29PM - 24 Feb 20 UTC. closed 05:23PM - 20...
Read more >
Different Ways to fix "Error running android: Gradle project ...
For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project...
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