mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 561 forks source link

Not work with compileSdkVersion 29 #511

Open invyctus92 opened 4 years ago

invyctus92 commented 4 years ago

Not work with compileSdkVersion 29

Hello, I have updated compileSdkVersion, to match the new conditions of android, from 28 to 29. Now the package doesn't work, after start, it starts the process related to the start event but after the app freeze and after crasha, you can give me a hand. Thanks

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

ext { compileSdkVersion = 29 targetSdkVersion = 29 buildToolsVersion = "29.0.3" supportLibVersion = "29.0.3" // googlePlayServicesVersion = "11.8.0" // googlePlayServicesVersion = "9.8.0" googlePlayServicesVersion = "+" gradle3EXPERIMENTAL = "yes" googlePlayServicesAuthVersion = "16.0.1"

// firebaseVersion = "17.3.4" // default: "+"

}

buildscript { repositories {

    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"
    }

    maven { url 'https://maven.fabric.io/public' } // fabric & crashlytics

    google()

}

dependencies { classpath 'com.android.tools.build:gradle:3.4.1'

  classpath 'com.google.gms:google-services:4.3.2'  // Google Services plugin
  classpath 'io.fabric.tools:gradle:1.+' // fabric & crashlytics

  classpath 'com.bugsnag:bugsnag-android-gradle-plugin:3.+'

  classpath 'com.google.gms:google-services:4.3.2'

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

} }

allprojects { repositories { mavenLocal() google() // <-- Add this line above jcenter jcenter()

    mavenLocal()
    maven { url 'https://jitpack.io' }
    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"
    }
    maven {
      url "$rootDir/../node_modules/react-native-background-fetch/android/libs"
    }
    google()
    jcenter()

     configurations.all {
        resolutionStrategy {
            force "com.android.support:appcompat-v7:$supportLibVersion"
        }
    }
}
//add the folllowing lines to force libs to use recent buildtools
subprojects {
    afterEvaluate {
        project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion = 29
                    buildToolsVersion = "29.0.3"

                }
            }
    }
}

}

`

nopmengkoung commented 3 years ago

Same +1

jacobusg commented 3 years ago

same here

Adigezalov commented 3 years ago

same +1

aljaz00 commented 3 years ago

Same for me, I get this error: image

MilosR commented 3 years ago

Tested it with compileSdkVersion 29, first I got exception error in logcat and app freezes on BackgroundGeolocation.start(). Try to add:

implementation 'com.google.android.gms:play-services-location:15.0.1'

into dependencies in app/build.gradle

That resolved problem in my case.