4
votes

The following error appears when try to build my react native for production (running ./gradlew assembleRelease),

...

/node_modules/react-native-mauron85-background-geolocation/android/common/src/oreo/java/com/marianhello/bgloc/NotificationHelper.java:4: error: cannot find symbol import android.app.NotificationChannel; ^ symbol: class NotificationChannel location: package android.app

...

Execution failed for task ':react-native-mauron85-background-geolocation-common:compileOreoReleaseJavaWithJavac'

Anybody encountered this error before?

1
Me to have this error. Any luck with you?user2473015
Didi you find any solution?masud_moni
Do you have any example, I have got many link and sample there but could not found which method should I call and whereMd. Parvez Alam

1 Answers

0
votes

Just adding what solved my problem in case anyone is having the same problem.

After tearing off a lot of hairs (although I lack it) I came to a solution. Not sure whether is gonna work for others, you can give it a try.

Add following codes in android/build.gradle

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "https://maven.google.com" }
        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
    targetSdkVersion = 26
    buildToolsVersion = "26.0.2"
    supportLibVersion = "26.1.0"
    googlePlayServicesVersion = "11.8.0"
}

And make sure the dependencies are installed.