Android 错误:未能解析:org.json:json:20160810

Android 错误:未能解析:org.json:json:20160810,android,gradle,Android,Gradle,我刚刚将我的android studio升级到3.0 canery 1。现在我在同步我的项目时遇到了一个问题,这个项目在我以前版本的android studio上运行得很好 这是我的档案 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.**

我刚刚将我的android studio升级到3.0 canery 1。现在我在同步我的项目时遇到了一个问题,这个项目在我以前版本的android studio上运行得很好

这是我的档案

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.******.app"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.afollestad:bridge:5.1.2'
    compile 'com.vistrav:ask:2.4'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.thefinestartist:finestwebview:1.2.7'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.google.android.gms:play-services-places:10.0.1'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

您的项目具有
org.json:json:20160810
工件(直接注入或间接(如其他工件的提供者)),但无法从本地/远程repo进行查找

并确保您的项目中有存储库

repositories {
    mavenCentral()
    jcenter({url "http://jcenter.bintray.com/"})
}
希望您已连接到Internet,以便它可以从远程回购中找到:


如果选中了“脱机工作”收件箱,请转到“文件>设置>渐变”,然后取消选中并再次尝试同步。

exclude org.json它已在框架中可用

 compile('com.afollestad:bridge:5.1.2') {
        exclude group: 'org.json', module: 'json'
    }

使项目缓存无效并重新启动项目。我已使其正常工作。我不得不排除org.json,因为其中一个依赖项需要org.json,而该依赖项在平台中已经可用。谢谢你的回答。太好了:)我对android有点新:你在这里建议的修复方案是什么?是否要将这3行添加到依赖项?或者替换他文件中已有的一些行?@TahoeWolverine-这在你模块的build.gradle中的依赖项部分。是的,我意识到你的意思是删除现有的:桥依赖项并替换为这3行。美好的