Mongodb 如何解决Android Studio 3.0的错误(25.13)?

Mongodb 如何解决Android Studio 3.0的错误(25.13)?,mongodb,android-studio,Mongodb,Android Studio,这是我尝试编译应用程序时显示的内容 我正在尝试使用MongoDB Stitch并将以下内容放入build.grandle(项目测试): maven { url "https://oss.sonatype.org/content/repositories/snapshots" } 看起来像这样: // Top-level build file where you can add configuration options common to all sub-projects/modul

这是我尝试编译应用程序时显示的内容

我正在尝试使用MongoDB Stitch并将以下内容放入build.grandle(项目测试):

maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
}
看起来像这样:

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

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'

 android {
    compileSdkVersion 23
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.example.hasslerisaac.ruffy"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'org.mongodb:stitch:1.0.0-SNAPSHOT'
}
在build.grandle(模块应用程序)中,我还添加了以下代码:

compile 'org.mongodb:stitch:1.0.0-SNAPSHOT'
在如下所示的依赖项中:

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

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'

 android {
    compileSdkVersion 23
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.example.hasslerisaac.ruffy"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'org.mongodb:stitch:1.0.0-SNAPSHOT'
}
错误

错误:(25,13)未能解析:org.mongodb:stitch:1.0.0-SNAPSHOT 放映 在“项目结构”对话框中显示


所有这些都如MongoDB页面所示,用于将集群的Stitch应用程序加入到应用程序中。请提供帮助。

看起来
stitch 1.0.0-SNAPSHOT
依赖项不在maven central中。maven包的
SNAPSHOT
版本通常就是这种情况

当我查看stitch项目的最新版本时,我可以看到他们为这个包提供了所谓的快照存储库

根据他们的建议,请添加快照存储库,软件包应该可以很好地解决:

repositories {
    // TODO: Remove once BSON 3.5.0 is released
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
}

看起来,
stitch 1.0.0-SNAPSHOT
依赖项不在maven central中。maven包的
SNAPSHOT
版本通常就是这种情况

当我查看stitch项目的最新版本时,我可以看到他们为这个包提供了所谓的快照存储库

根据他们的建议,请添加快照存储库,软件包应该可以很好地解决:

repositories {
    // TODO: Remove once BSON 3.5.0 is released
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
}