代码之家  ›  专栏  ›  技术社区  ›  Achraf

带有react native错误的Fabric crashlytics

  •  0
  • Achraf  · 技术社区  · 6 年前

    在android的react原生应用中 tutorial . 但在使用 react-native install react-native-fabric 我试着和应用程序共进午餐 npm run android 我有个错误:

    配置项目时出现问题:“react native fabric”。

    无法解析配置“:react native fabric:classpath”的所有文件。

    找不到lint-gradle-api.jar(com.android.tools.lint:lint-gradle-api:26.1.2)。 在以下位置搜索: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

    build.gradle :

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        ext {
            buildToolsVersion = "27.0.3"
            minSdkVersion = 16
            compileSdkVersion = 27
            targetSdkVersion = 26
            supportLibVersion = "27.1.1"
            googleServicesVersion = "17.1.0"
        }
    
        repositories {
            maven { url 'https://maven.fabric.io/public' }
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
            google()
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.4'
    
            // These docs use an open ended version so that our plugin
            // can be updated quickly in response to Android tooling updates
    
            // We recommend changing it to the latest version from our changelog:
            // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
            classpath 'io.fabric.tools:gradle:1.+'
    
        }
    }
    
    
    plugins {
        id 'com.palantir.git-version' version '0.11.0'
    }
    
    allprojects {
        repositories {
            mavenLocal()
            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"
            }
    
            maven { url "https://jitpack.io" }
            google()
            maven { url 'https://oss.sonatype.org/service/local/repositories/snapshots/content/' }
            maven { url 'https://oss.sonatype.org/service/local/repositories/releases/content/' }
            jcenter()
        }
    
        tasks.whenTaskAdded { task ->
            if (task.name.contains("lint")) {
                if (!task.toString().contains("app")) {
                    task.enabled = false
                }
            }
        }
    }
    
    ext {
        apkCode = 1
    
        // Apisense dependecies
        apisenseVersion = "1.12.0.beta2"
        apisenseDevVersion = "1.13.1-alpha-SNAPSHOT"
        intentStingVersion = "0.0.1-alpha"
        intentStingDevVersion = "0.0.1-alpha-SNAPSHOT"
    }
    
    1 回复  |  直到 6 年前
        1
  •  8
  •   Vinzzz    6 年前

    这是一个问题 react-native-fabric 自己的build.gradle文件。。。以及JCenter maven存储库。

    看看他们github上的这个问题: https://github.com/corymsmith/react-native-fabric/issues/200

    node_module/react-native-fabric/android/build.gradle 文件(更改maven存储库顺序,将Jcenter向下移动到Google)

    编辑

    node_module android/build.gradle ). 这是我的配置修复了它(我不是Gradle专家,你的可能不同)

    allprojects {
        repositories {
            mavenLocal()
            google()
    
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            maven {
                // Firebase : Google Play services from 11.2.0 +
                url 'https://maven.google.com'
            }
            jcenter()
            configurations.all {
                resolutionStrategy {
                    // fix dependency problem on react-native-maps 0.20.1
                    //force "com.android.support:support-v4:27.1.0"
                }
            }
        }
    
        buildscript {
            repositories {
                mavenLocal()
                google()
    
                maven {
                    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                    url "$rootDir/../node_modules/react-native/android"
                }
                maven {
                    // Firebase : Google Play services from 11.2.0 +
                    url 'https://maven.google.com'
                }
                jcenter()
                configurations.all {
                    resolutionStrategy {
                        // fix dependency problem on react-native-maps 0.20.1
                        //force "com.android.support:support-v4:27.1.0"
                    }
                }
            }
        }
    
    }