React-native-ble-plx: Cannot build Android project

Created on 28 Mar 2020  路  3Comments  路  Source: Polidea/react-native-ble-plx

Question

I have created a new project where I want to try the library. I can build & run with no problems on iOS. When trying to build on Android I see the following error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-ble-plx'.
> No such property: variantManager for class: com.android.build.gradle.LibraryPlugin

Environment

React Native : 0.61.6

Android SDK
Screenshot 2020-03-28 at 19 44 32

build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven { url 'https://jitpack.io' }
    }
}


wrapper {
    gradleVersion = '4.7'
    distributionUrl = distributionUrl.replace("bin", "all")
}
question

Most helpful comment

It turned out to be a versioning problem. Using React Native 0.60.5 and gradle 3.4.1 as in the example setup fixed the problem for me.

All 3 comments

Someone else has reported it on StackOverflow too: https://stackoverflow.com/questions/60811083/no-such-property-variantmanager

I also have a same problem.
My rn version is 0.60.5

It turned out to be a versioning problem. Using React Native 0.60.5 and gradle 3.4.1 as in the example setup fixed the problem for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devgeno picture devgeno  路  4Comments

nriccar picture nriccar  路  3Comments

adyanced picture adyanced  路  5Comments

rottenoats picture rottenoats  路  4Comments

BlackCod3 picture BlackCod3  路  3Comments