eddieowens / react-native-boundary

Native implementation of geofencing/region monitoring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant get Module to compile

Code-Tap opened this issue · comments

First Error
screenshot from 2018-08-27 21-38-43

So i Commented out both google() entries from the Build.Gradle
Then i get the following
screenshot from 2018-08-27 21-43-01

And then I commented out the dependency and got the following
screenshot from 2018-08-27 21-45-26

I Assume i'm doing something horribly wrong here.
Being a complete noob I'd love to have some idea what ?! :)

Hey @Code-Tap, this looks like a problem with your android/build.gradle file. Check to see that you have all the repositories added like so:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        // 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"
        }
        google()
    }
}

And it should work. If not, I'd check out this thread for more help. Let me know how it goes!

Im getting that error as well!
Tried couple of solution including yours, its not working.

This is the android/build.gradle file that I'm using in my own project with this lib:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.2.1'
    }
}

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

ext {
    compileSdkVersion = 26
    minSdkVersion = 16
    targetSdkVersion = 26
    buildToolsVersion = "27.0.3"
    supportLibVersion = "27.1.0"
    googlePlayServicesVersion = "15.0.1"
    firebaseVersion = "15.0.2"
    gradle3EXPERIMENTAL = "yes"
    androidMapsUtilsVersion="0.5+"
}

Without seeing your android/build.gradle file it's a bit difficult to parse exactly why you'd be having this problem.

I think maven { url "https://jitpack.io" } is the one thats causing the build to fail. Im gonna check it out when I get the chance and let u guys know!

Thanks!

I tried to copy to your build but it didnt work. I tried copying the maven{url "https://jitpack.io"} and It still didnt work.

My build :
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
        maven {
                url "https://maven.google.com"
            }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.2.1'
    }
}

allprojects {
    repositories {
        mavenLocal()
                google()
        jcenter()
        maven {
                url "$rootDir/../node_modules/react-native/android"
            }
            maven {
                url "https://maven.google.com"
            }
        maven { url "https://jitpack.io" }
    }
}

ext {
    compileSdkVersion = 26
    minSdkVersion = 16
    targetSdkVersion = 26
    buildToolsVersion = "27.0.3"
    supportLibVersion = "27.1.0"
    googlePlayServicesVersion = "15.0.1"
    firebaseVersion = "15.0.2"
    gradle3EXPERIMENTAL = "yes"
    androidMapsUtilsVersion="0.5+"
}

@TareqAbughosh, what's the exact error you're getting?

@eddieowens I had the same error the OP had. I fixed it and its working great now then I had way more errors that I can't even remember... But they were dependencies errors. Just 1 question though.. Can I use this in the background? or at least register it as a service?(if yes, do u have any package that does that? or at least a page where it explains how to do it?)
Heres my android/build.gradle file (I've more than just this package..)

New Text Document.txt

Thanks a lot for the help and for this package!

@TareqAbughosh that's great! Yes this library works in the background as long as you follow the README but there are some problems with Android being inconsistent and I can't figure out why. I have a question posted here to hopefully get some help. If you have any suggestions as to why this may happen I'd love to hear them or if you can upvote my question to increase its visibility that'd be great. iOS has no problems though and works as expected.

I'm not sure why!

I used another package to run it in the background But I reckon using a webview from react native would also execute the job right?

P.S: I tried to upvote u but it said I don't have enough rep (Cuz I just made the account :X)