react-native-network-info
react-native-network-info copied to clipboard
error setup
use "react-native": "0.49.3", "react-native-network-info": "^3.2.2",
BUMP use gradle 2.2.3
@rusmichal i use gradle 2.2.3
but still failed
The current version of the library (3.2.2) requires Gradle 3 or higher. If you need to use Gradle 2 you'll need to use version 3.1.0.
The 3.2 upgrade should have been a 4.0 release since it's a breaking change. I'll try to clean this up soon or at least update the readme.
I just did remove google() and did change gradle version to 1.3.1 and all works fine.
Below version is available to me.
classpath 'com.android.tools.build:gradle:3.1.0' distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
@appaaaa can you tell me where you changed this please? And is this PR related to this issue: https://github.com/pusherman/react-native-network-info/pull/54. I guess it is, am I right?
Hi all,
I'm having the same problem. I've tried to change my gradle plugin to 3.1.0, and also use distribution gradle-4.4-all.zip. This ends up causing problems with react-native-os package.
Here is my build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
@natterstefan I'm using this android/build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
android/gradle/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
+1 Did anyone have a solution, I try both react-native link and manual link, but it doesn't work
Looks like, I am missing some necessary package in android/build.gradle and upgrade to gradle-4-4 , and everything works fine
here some screenshot, notice the modified and new line in those files
in your_app/android/build.gradle
in your_app/android/gradle/wrapper/gradle-wrapper.properties