balthazar / react-native-zeroconf

:satellite: Discover Zeroconf services using react-native
MIT License
220 stars 97 forks source link

Cannot build with latest RN #86

Open rolandjitsu opened 5 years ago

rolandjitsu commented 5 years ago

I'm having some issues using this lib, it fails when it's building it:

> Configure project :react-native-zeroconf
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Checking the license for package Android SDK Platform 23 in /Users/rolandgroza/Library/Android/sdk/licenses
Warning: License for package Android SDK Platform 23 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-zeroconf'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-23 Android SDK Platform 23
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /Users/rolandgroza/Library/Android/sdk

* 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 1s
error 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
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

Is there any way to work around this issue?

bumpah commented 5 years ago

came across with this issue as well with RN 60.5, simple solution is to add following piece of code at the end of your android/build.gradle and issue seems to get fixed.

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion "28.0.3"
            }
        }
    }
}

hope this helps to solve the issue!