How to build CHAQUOPY Android library (.AAR or .JAR file) in Android Studio

Gécs Bernát

I am trying to use chaquopy https://chaquo.com/chaquopy/ android plugin for developing an android app that uses python script for some serious calculations, and I would like to make the app module as an android library (.AAR) to be able to reuse that in other project. (.eg ionic app).

When I change apply plugin: 'com.android.application' to apply plugin: 'com.android.library' as suggested here: https://developer.android.com/studio/projects/android-library then resync project gradle, I get this error:

Could not get unknown property 'applicationVariants' for object of type com.android.build.gradle.LibraryExtension.

After googling it I get this solution: could not get unknown property for 'applicationVariants' for BuildType_Decorated

So I change applicationVariants.all to libraryVariants.all or testVariants.all.

But the error is still present, and cant build the project.

Image:

error

So https://chaquo.com/chaquopy/ can not be imbedded in android library?

mhsmith

This is now supported starting in Chaquopy version 8.0.0. See the documentation for details.

The Chaquopy plugin can also be used in an Android library module (AAR). However, it can only be used in one module in a project: either in the app module, or in exactly one library module. Attempting to use it in multiple modules will give the error “More than one file was found with OS independent path”.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I build an .aar library with shrunk classes in Android Studio?

Android Studio Create AAR using another AAR file and jar inside

How to build AAR from Android Library?

How to build Flutter project with Android aar file?

How to create *.aar file from "existing" android studio project ( Not creating new android library)?

How to remove .aar file form Android Studio

Export Android Library as AAR file

Android Studio: How to read classes from a jar file from a library?

Problems with using a jar file as a library in android studio

Android Archive Library (aar) vs standard jar

Publish an Android library to Maven with aar and source jar

How to build an android library with Android Studio and gradle?

Create aar file in Android Studio

Android Studio how to package single AAR from multiple library projects?

How to exclude a file from an .AAR Android library archive with gradle

Android Studio Gradle build "apply plugin: 'com.android.library'": aar missing files

How to export library to Jar in Android Studio?

how to create library ( jar ) in android studio ?

Include jar file with Java sources in Android aar

Android Studio release build does not output aar

[Jar][Android P] How to build a jar library into /vendor/framework

How to import a .aar file into Android Studio 1.1.0 and use it in my code

Android failed to rename aar file in build

Android NDK build cmake include .so library included in .aar library

Chaquopy in Android Studio module not found

How to create new Android AAR in Android Studio

Android Studio: Add jar as library?

Android studio aar file error class not found

Class in AAR file not available in Android Studio