Custom plugin with aar library

Hi, I’m new to capacitor and I’m trying to create a plugin that relies on a aar library.
I generated the plugin with capacitor cli and managed to make it work on the plugin project (it does recognize the aar library)
However, when i do the npm link and npm install of the plugin, the aar es not recognized:

node_modules/capacitor-plugin-custom/android/build.gradle' line: 61
A problem occurred evaluating project ':capacitor-plugin-continuousspeech'.
> Project with path ':kaldi-android-5.2' could not be found in project ':capacitor-plugin-custom'.

Line 61 is implementation project(':kaldi-android-5.2')

dependencies {
	implementation fileTree(include: ['*.jar'], dir: 'libs')
	implementation project(':capacitor-android')
	testImplementation "junit:junit:$junitVersion"
	androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
	androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
	implementation project(':kaldi-android-5.2')
	implementation 'androidx.appcompat:appcompat:1.2.0'
}

However, the kaldi-android-5-2 folder is present and its build.gradle imports the kaldi-android-5.2.aar

Any ideas on what I’m doing wrong?

Running into the same issue. Have you found a solution yet @pcaselas?

No! Sorry.

In this case, I’ve found that they have a maven repo, and works fine using it.

Ok, thanks for the reply. I was also able to resolve mine … from jcenter().

I have the same problem. Is there any documentation available on how to resolve it or how to use it?

same here, 4 years later and I have found no documentation or possible fix, did anyone manage to solve it?

There is no documentation for this, as there is nothing Capacitor-specific to consider here. You integrate the aar library like in any other Android project.

1 Like