热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

无法为参数[project':react-native-sqlite']找到方法compile()

如何解决《无法为参数[project':react-native-sqlite']找到方法compile()》经验,为你挑选了1个好方法。

react-native-cli:2.0.1反应原生:0.42.0 npm:3.5.2

我使用本教程安装sqlite on react native:https: //github.com/remobile/react-native-sqlite 当我完成后我执行了这个命令:react-native run-android我有这个错误:

Cannot parse yarn version: 0.22
Scanning 547 folders for symlinks in /home/sofiane/projet/sql/node_modules (6ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* Where:
Build file '/home/sofiane/projet/sql/android/build.gradle' line: 9

* What went wrong:
A problem occurred evaluating root project 'sql'.
> Could not find method compile() for arguments [project ':react-native-sqlite'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    compile project(':react-native-sqlite')
        // 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"
        }
    }
}

小智.. 6

你应该配置/android/app/build.gradle'而不是/android/build.gradle'.



1> 小智..:

你应该配置/android/app/build.gradle'而不是/android/build.gradle'.


推荐阅读
author-avatar
靳淑怡心淑怡綺
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有