JoaoCnh / react-native-android-voice

react-native-android-voice is a speech-to-text library for React Native for the Android Platform.
MIT License
101 stars 33 forks source link

SDK 26 is a problem #35

Closed arasemami closed 6 years ago

arasemami commented 6 years ago

when I install package and linking in my project i cannot get build an app , and have this issue:

`FAILURE: Build failed with an exception.

My package.json:

 "dependencies": {
    "native-base": "^2.8.0",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-android-voice": "^0.6.0",
    "react-native-cli": "^2.0.1",
    "react-native-splash-screen": "^3.1.1",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "^2.12.1",
    "react-timer-mixin": "^0.13.4"
  },

My android/build.gradle:


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

        // 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"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

ext {
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}
arasemami commented 6 years ago

I solved this issue:

added this code in android/build.gradle

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 26
                buildToolsVersion '26.0.0'
            }
        }
    }
}

it will working .