2017-10-25 17 views
1

私は、Android Studioの上でこのエラーが午前:は解決に失敗しました:com.android.support:palette-v7:26.0.1

Error:Failed to resolve: com.android.support:palette-v7:26.0.1 
Install Repository and sync project 
Open File 
Show in Project Structure dialog 

は、私が「リポジトリとの同期プロジェクトをインストールする」をクリックすると何も起こりませんが。

私は既にチェックし、同様の質問の回答を試みました。しかし、まだ問題は残っています。

apply plugin: 'com.android.application' 
apply from: "$rootDir/utils.gradle" 
apply plugin: 'io.fabric' 

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 

//repositories { 
// maven { url 'https://maven.fabric.io/public' } 
//} 

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
     maven { url 'https://maven.fabric.io/public' } 
    } 
} 


android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 

    def applicationName = "xyz" 

    defaultConfig { 
     applicationId "xyz" 
     minSdkVersion 15 
     targetSdkVersion 26 
     versionCode 16 
     versionName "1.7" 
     manifestPlaceholders = [onesignal_app_id    : "xyz", 
           // Project number pulled from dashboard, local value is ignored. 
           onesignal_google_project_number: "REMOTE"] 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     buildConfigField 'String', 'END_POINT', toJavaCodeString(END_POINT) 
    } 

    signingConfigs { 
     debug { 
      keyAlias 'androiddebugkey' 
      keyPassword 'android' 
      storePassword 'android' 
      storeFile file('../keystore/debug.jks') 
     } 
     release { 
      keyAlias 'xyz' 
      keyPassword 'xyz' 
      storePassword 'xyz' 
      storeFile file('../../../Keystore/xyz.keystore') 
     } 
    } 

    productFlavors { 
     dev { 
      signingConfig signingConfigs.debug 
      versionCode defaultConfig.versionCode 
      versionName defaultConfig.versionName 
      applicationId "xyz" 
     } 

     prod { 
      signingConfig signingConfigs.release 
      versionCode defaultConfig.versionCode 
      versionName defaultConfig.versionName 
      applicationId "xyz" 
     } 

    } 

    buildTypes { 

     release { 
      minifyEnabled true 
      shrinkResources true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      signingConfig getSigningConfig() 
      applicationVariants.all { variant -> 
       variant.outputs.each { output -> 
        def date = new Date(); 
        def formattedDate = date.format('dd-MM - HH:mm:ss') 
        output.outputFile = new File(output.outputFile.parent, 
          output.outputFile.name.replace("app-prod-release", applicationName + " v" + defaultConfig.versionName + " - " + formattedDate) 
        ) 
       } 
      } 

     } 

     debug { 
      minifyEnabled false 
      shrinkResources false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), "rules-proguard-debug.pro" 
      signingConfig signingConfigs.debug 
     } 

    } 

    lintOptions { 
     abortOnError false 
    } 

} 

ext { 
    supportLibraryVersion = "26.0.1" 
} 

repositories { 
    mavenCentral() 
    jcenter() 
    maven { 
     url "https://jitpack.io" 
    } 
    maven { 
     url "https://maven.google.com" 
    } 
} 

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:${supportLibraryVersion}" 
    compile "com.android.support:design:${supportLibraryVersion}" 
    compile "com.android.support:palette-v7:${supportLibraryVersion}" 
    compile "com.android.support:recyclerview-v7:${supportLibraryVersion}" 
    compile "com.android.support:cardview-v7:${supportLibraryVersion}" 
    compile "com.android.support:customtabs:${supportLibraryVersion}" 
// compile "com.android.support:support-dynamic-animation:${supportLibraryVersion}" 
    compile 'com.tsengvn:typekit:1.0.1' 
    compile 'com.jakewharton.timber:timber:4.5.0' 
    compile 'com.mikepenz:iconics-core:[email protected]' 
    compile 'com.mikepenz:fontawesome-typeface:[email protected]' 
    compile 'com.mikepenz:community-material-typeface:[email protected]' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'pub.devrel:easypermissions:0.2.1' 
    compile('com.github.ozodrukh:CircularReveal:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.google.code.gson:gson:2.8.0' 
    compile 'com.squareup:otto:1.3.8' 
    compile 'com.balysv:material-ripple:1.0.2' 
    testCompile 'junit:junit:4.12' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile 'me.zhanghai.android.materialprogressbar:library:1.3.0' 
    compile 'com.inthecheesefactory.thecheeselibrary:adjustable-imageview:1.0.0' 
    compile 'com.github.florent37:viewanimator:1.0.5' 
    compile 'com.github.ybq:Android-SpinKit:1.1.0' 
// compile 'com.google.android.gms:play-services-ads:11.0.4' 
    compile 'com.afollestad.material-dialogs:core:0.9.4.7' 
    compile 'com.afollestad.material-dialogs:commons:0.9.4.7' 

// compile 'com.onesignal:OneSignal:[email protected]' 
// compile 'com.google.android.gms:play-services-gcm:11.0.4' 
    compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]' 

    def gmsVersion = '11.2.+' 
    compile("com.google.android.gms:play-services-gcm:${gmsVersion}") { 
     force = true 
    } 
    compile("com.google.android.gms:play-services-location:${gmsVersion}") { 
     force = true 
    } 
    compile("com.android.support:support-v4:${supportLibraryVersion}") { 
     force = true 
    } 
    compile("com.android.support:support-v13:${supportLibraryVersion}") { 
     force = true 
    } 
    compile("com.android.support:customtabs:${supportLibraryVersion}") { 
     force = true 
    } 

    compile 'com.google.android.gms:play-services-ads:' + gmsVersion 

    compile 'com.anjlab.android.iab.v3:library:1.0.+' 

// compile 'org.solovyev.android:checkout:1.0.0' 

// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' 
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' 
// testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' 

} 

プロジェクトおよびアプリケーションレベルの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.3.3' 

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

allprojects { 
    repositories { 
     mavenCentral() 
     jcenter() 
     maven { 
      url "https://jitpack.io" 
     } 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 

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

はここに私のアプリレベルのbuild.gradleのコードです:

は、ここに私のプロジェクトレベルのbuild.gradleのコードです。

ありがとう!

+0

https://stackoverflow.com/a/46047978/3395198 –

+0

すでに試してみましたが、この質問を投稿しました。それらのものは私のために働いていません。 @IntelliJAmiya – AnEnthusiast

+0

この質問を再度開きます。あなたのプロジェクトレベルを表示する 'build.gradle' –

答えて

3

これが最良の方法です。

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
     google() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     mavenCentral() 
     jcenter() 
     google() 
    } 
} 

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

とあなたのgradle-wrapper.propertiesファイル内に必ずある作るアプリレベルのbuild.gradleにも

distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip 

以下のようにラッパーのバージョンを変更するには、以下のルートレベルgradle.buildの使用では

以下のように26ベシオンを使用する。

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.2" 
    defaultConfig { 
     applicationId "com.xxxx" 
     minSdkVersion 16 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
関連する問題