pusherman / react-native-network-info

React Native library for getting information about the devices network
MIT License
357 stars 106 forks source link

error setup #53

Open quocson1 opened 6 years ago

quocson1 commented 6 years ago

image image

use "react-native": "0.49.3", "react-native-network-info": "^3.2.2",

rusmichal commented 6 years ago

BUMP use gradle 2.2.3

quocson1 commented 6 years ago

@rusmichal i use gradle 2.2.3 image but still failed

pusherman commented 6 years ago

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.

mitevdev commented 6 years ago

I just did remove google() and did change gradle version to 1.3.1 and all works fine.

appaaaa commented 6 years ago

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

natterstefan commented 6 years ago

@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?

only1chi commented 6 years ago

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"
        }
    }
}
appaaaa commented 6 years ago

@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
WaterNguyen96 commented 6 years ago

+1 Did anyone have a solution, I try both react-native link and manual link, but it doesn't work

WaterNguyen96 commented 6 years ago

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 screen shot 2018-07-11 at 2 40 31 pm

in your_app/android/gradle/wrapper/gradle-wrapper.properties screen shot 2018-07-11 at 2 40 44 pm