错误:无法解决:com.github.bumptech.glide:glide:4.0.0-SNAPSHOT

时间:2016-06-08 19:41:53

标签: android-studio github-api android-glide

的build.gradle(模块:APP)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "com.example.beetel.App"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"



    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}
repositories {
    mavenCentral() // jcenter() works as well because it pulls from Maven Central
   maven{ url "https://jitpack.io"}
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    //glide libraries
    compile 'com.android.support:palette-v7:23.3.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.florent37:glidepalette:2.0.0'
    compile 'com.github.bumptech.glide:okhttp-integration:1.3.1@aar'
    //            { transitive = true;}
    //            { exclude group: 'com.squareup.okhttp';}
    //compile 'com.google.code.gson:gson:2.6.1'
    //retrofit,square,rxjava libraries
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
    compile 'io.reactivex:rxjava:1.1.1'
    compile 'io.reactivex:rxandroid:1.1.0'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
    //android support libraries
    compile 'com.android.support:appcompat-v7:23.3.0'
    //    compile'com.android.support:appcompat-v4:23.2.0'
    //    compile 'net.steamcrafted:materialiconlib:1.0.9'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    //    compile project(':AndroidBootstrap')
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.github.jd-alexander:LikeButton:0.1.8'
    compile 'com.facebook.stetho:stetho-okhttp3:1.3.0'
    compile 'com.facebook.stetho:stetho-okhttp:1.3.0'
}

Build.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.1.0'

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

allprojects {
    repositories {
        jcenter()
//        maven{
//           url "https://oss.sonatype.org/content/repositories/snapshots"}
//        maven
//                {
//                    url "http://dl.bintray.com/florent37/maven"
//
//                }

        }
    }


task clean(type: Delete) {
    delete rootProject.buildDir
}

的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.beetel.App">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application
        android:allowBackup="true"
        android:largeHeap="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data android:name="com.example.beetel.App.utilities.ConfigGlide"
            android:value="GlideModule"/>
        <provider
            android:authorities="com.example.beetel.App."
            android:name="com.example.beetel.App.data.model.MoProvider"/>
        <activity android:name="com.example.beetel.App.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.Main">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name="com.example.beetel.App.MoDActivity"
            android:label="@string/title_activity_modetails"
            android:parentActivityName="com.example.beetel.App.MainActivity"
            android:theme="@style/AppTheme.Detail">
            <meta-data android:name="android.support.PARENT_ACTIVITY"
                android:value="com.example.beetel.App.MainActivity"/>
        </activity>

    </application>

</manifest>

我无法理解为什么错误会一次又一次地出现? 我想实现滑动调色板以获得更有效的UI。 我试图使缓存/重启,重建项目,清理项目等无效。 请帮助我...坚持这个无法进一步调试.Deadlines接近.. 提前谢谢!

Gradle Build后的消息 Message after Gradle Build

4 个答案:

答案 0 :(得分:3)

在Build.gradle(Proyect app)中添加此

allprojects {
repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
    maven  {
        url "http://repo1.maven.org/maven2"
    }
  }
}

在Build.gradle(模块应用)中添加依赖项 com.github.bumptech.glide:glide:3.7.0

dependencies {

...
compile 'com.github.bumptech.glide:glide:3.7.0'

compile 'com.android.support:appcompat-v7:24.0.0-beta1'
...

}

答案 1 :(得分:2)

我也遇到了同样的错误。将这些行添加到repo并同步项目。

为我工作就像一个魅力。

repositories {
              mavenCentral()

              jcenter() 
              if (project.hasProperty('local.repo'))
              {
                maven { name 'glide-local'; url project.property('local.repo') }
              } 
              maven { name 'glide-snapshot'; url 'http://oss.sonatype.org/content/repositories/snapshots' }
              flatDir name: 'libs', dirs: 'libs'
             maven 
             {
                url "https://jitpack.io"
             }
 }

答案 2 :(得分:0)

我遇到了这个问题并通过将这些行放在build.gradle(Module:app)

中来修复它
repositories {
    mavenCentral() // jcenter() works as well because it pulls from Maven Central
}

并修复了

答案 3 :(得分:0)

我有这个问题。如果你有这个错误,那是因为你需要使用jitpack.io来使用-SNAPSHOT。

所以你只需复制一下:

    maven { url 'https://jitpack.io' }

在你的文件build.gradle中(模块:app) 如果您从未触摸此文件,它看起来像这样:

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

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.1'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
allprojects {
repositories {
    google()
    jcenter()
    maven { url 'https://jitpack.io' }
}
}