karandpr / cordova-plugin-android-rootbeer

A wrapper plugin for rootbeer library. This library is used to detect root on Android Devices.
Apache License 2.0
7 stars 7 forks source link

Unable to build in an ionic - cordova app #10

Closed Arj-Shankar closed 1 year ago

Arj-Shankar commented 1 year ago

Getting the following exception when trying to create the android build

Could not find method compile() for arguments [com.github.scottyab:rootbeer:0.0.8] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Using the following -

cordova-android 11 Java 11 Gradle 6.8.3 Intel Mac (v12.0.1)


Tried removing and re-adding the platform and the plugin multiple times.

Installed the plugin by running the command ionic cordova plugin add cordova-plugin-android-rootbeer@0.0.8

karandpr commented 1 year ago

Okay. This is strange but let me check over the weekend.

CaioMelo8 commented 1 year ago

@Arj-Shankar, cordova-android@11 uses Gradle 7.4.2 by default, which has already removed the compile() configuration that's deprecated for a good while. Now implementation() must be used instead.

The simple fix is to update the plugin build-extras.gradle to something like this:

repositories{
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.scottyab:rootbeer:0.0.8'
}