Currently, I am working on a NativeScript plugin that involves wrapping functionalities from a JAVA library. The usual method followed by users is to define a dependency using `compile 'org.namespace:library:x.y.z'` in `src/platforms/android/include.gradle`. However, the specific library I am working with is not available in any JAVA repositories; instead, it is in a standalone `.jar` file.
I have attempted various suggestions that are commonly used for actual Android apps, but as NativeScript operates differently, these methods have proven unsuccessful so far.
Here are the steps I have tried:
1) Modify `platforms/android/include.gradle`
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile name: 'SimpleNetworking'
}
2) Another modification in `platforms/android/include.gradle`
dependencies {
compile files('libs/SimpleNetworking.jar')
}
Both of my attempts resulted in failure when testing this plugin in a NativeScript app that requires it as a dependency:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration
':app:debugCompileClasspath'.
> Could not find :SimpleNetworking:.
Required by:
project :app
The specific plugin I'm currently addressing can be found here.
Update
Upon referring to the Android Studio documentation regarding build dependencies and making changes to the `include.gradle` file as follows:
dependencies {
implementation files('libs/SimpleNetworking.jar')
}
Now, it seems like the file has been located! However, there appears to be another issue:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Failed to transform file 'SimpleNetworking.jar' to match attributes {artifactType=processed-jar} using transform IdentityTransform
> Transform output file /Users/USERNAME/git/ons-testapp/platforms/android/app/libs/SimpleNetworking.jar does not exist.
It's unclear whether this error is related or something entirely new.