小编Vec*_*all的帖子

如何从根本上修复错误“无法找到参数 [directory 'libs'] 的方法compile()”?

我在查看所有类似的问题和答案后发布了这个问题。

这是我研究的问题。

找不到参数 Gradle 的方法compile()

Gradle 找不到参数的方法compile()

也许,您可能想知道这是一个重复的问题,但就我而言,事实并非如此。让我们看看情况如何。首先,这是错误来源的代码片段:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.facebook.react:react-native:+"
}
Run Code Online (Sandbox Code Playgroud)

此代码来自文件:node_modules/react-native-geocoder/android/build.gradle

现在让我向您展示出现的错误。

FAILURE: Build failed with an exception.

* Where:
Build file '/Project-root/node_modules/react-native-geocoder/android/build.gradle' line: 19

* What went wrong:
A problem occurred evaluating project ':react-native-geocoder'.
> Could not find method compile() for arguments [directory …
Run Code Online (Sandbox Code Playgroud)

android deprecated gradle node-modules react-native

18
推荐指数
2
解决办法
4万
查看次数

模块“glog.glog.log_severity”的导入出现在命名空间“google”中

我知道这是重复的,因为回答的解决方案对我不起作用,我再次询问,以防有人提出任何新的解决方案......

已经尝试过:

取消链接所有自动链接的模块并在 pod 文件中手动指定它们。

也尝试过

use_modular_headers!

pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false
Run Code Online (Sandbox Code Playgroud)

任何建议都非常感激。

ios cocoapods react-native

14
推荐指数
1
解决办法
1万
查看次数