سلام خدمت دوستان عزیز
هنگام بیلد شدن گریدل به خطای زیر برخوردم :
Gradle sync failed: Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
build.gradle(project: android)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:۲.۱.۳'
// 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'
}
}
}
build.gradle
apply plugin: 'com.android.library'
def DEFAULT_COMPILE_SDK_VERSION = ۲۶
def DEFAULT_BUILD_TOOLS_VERSION = "۲۶.۰.۳"
def DEFAULT_MIN_SDK_VERSION = ۱۶
def DEFAULT_TARGET_SDK_VERSION = ۲۶
android {
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode ۱
versionName "۱.۰"
}
}
dependencies {
compileOnly "com.facebook.react:react-native:+"
}
gradle-wrapper.propertis
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-۳.۳-all.zip
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟