1
votes

I'm new developing in react-native I have problem installing the react-native-maps to my project

In https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md

They say I need to change root build.gradle by replacing of this code

    ext {
    compileSdkVersion   = 26
    targetSdkVersion    = 26
    buildToolsVersion   = "26.0.2"
    supportLibVersion   = "26.1.0"
    googlePlayServicesVersion = "11.8.0"
    androidMapsUtilsVersion = "0.5+"
}

Now after i change my build.gradle to this

// ext {
    //     buildToolsVersion = "28.0.2"
    //     minSdkVersion = 16
    //     compileSdkVersion = 28
    //     targetSdkVersion = 27
    //     supportLibVersion = "28.0.0"
    // }
    ext {
        compileSdkVersion   = 26
        targetSdkVersion    = 26
        minSdkVersion = 16
        buildToolsVersion   = "26.0.2"
        supportLibVersion   = "26.1.0"
        googlePlayServicesVersion = "11.8.0"
        androidMapsUtilsVersion = "0.5+"
    }

I got a 2 error found after i re run my application

Configure project :app WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1. Android SDK Build Tools 28.0.3 will be used. To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Configure project :react-native-maps WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1. Android SDK Build Tools 28.0.3 will be used. To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Task :app:mergeDebugResources FAILED Error: Cannot create directory C:\xampp\htdocs\Tracker\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values

FAILURE: Build failed with an exception.

  • What went wrong: Failed to capture snapshot of output files for task ':app:mergeDebugResources' property 'incrementalFolder' during up-to-date check.

    Could not read path 'C:\xampp\htdocs\Tracker\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values'.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 21s 14 actionable tasks: 9 executed, 5 up-to-date Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html

Command failed: gradlew.bat installDebug

Error: Command failed: gradlew.bat installDebug at checkExecSyncError (child_process.js:637:11) at Object.execFileSync (child_process.js:655:13) at runOnAllDevices (C:\xampp\htdocs\Tracker\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19) at buildAndRun (C:\xampp\htdocs\Tracker\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12) at isPackagerRunning.then.result (C:\xampp\htdocs\Tracker\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12) at processTicksAndRejections (internal/process/next_tick.js:81:5)

Can you help me guys how can I fix the error?

1

1 Answers

0
votes

I believe that I fixed the same with following:

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion