sqlite - 找不到参数的方法 compile() [项目 ':react-native-sqlite']

标签 sqlite ubuntu react-native

react native -cli:2.0.1 react native :0.42.0 npm :3.5.2

我使用本教程在 React Native 上安装 sqlite: https://github.com/remobile/react-native-sqlite 当我完成后,我执行了这个命令: react native 运行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.

构建.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"
        }
    }
}

最佳答案

你应该配置<name-project>/android/app/build.gradle'不是 <name-project>/android/build.gradle' .

关于sqlite - 找不到参数的方法 compile() [项目 ':react-native-sqlite'],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42595854/

相关文章:

sqlite - SQLite 是否支持同一数据库中的多个模式?

eclipse - Ctrl 按钮在 Eclipse 中不起作用

javascript - 如何从接口(interface)或 promise 的内容中获取 "recieve" promise ?

sqlite - 如何在sqlite中逃脱?

php - 如何清除所有用户的 session ?

.net - 如何在 Nginx 服务器中将 ASP.NET Core Web API dll 文件作为服务运行?

javascript - 在 NavigationIOS 中推送 View 时如何传递对象而不是类型?

ios - 是否可以在没有 Swift 或 Objective-C 的情况下使用 Go 创建 iOS 应用程序?

react-native - 清洁 react 原生项目

sqlite - 将 sqlite3 与 IronPython 2.6 一起用于 .Net4