I followed this React Native error: "Could not determine java version from '9.0.1'." and changed to
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
in PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties
but this didn't slved my problem it showed me new error Cannot add task 'wrapper' as a task with that name already exists.