1

I want to build a simple fragment based App, but I can't load the lib.

Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/28.0.0/support-fragment-28.0.0.aar'

What I tried:

  1. update Proxy settings
  2. delete Proxy
  3. settings Check
  4. check Connection
  5. Add:
   // 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.4.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://maven.google.com'
        }

    }
}

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

Gradle.Properties


apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    defaultConfig {
        applicationId "com.example.fragmentmanagementmainactivity"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
    testImplementation 'junit:junit:4.13-beta-3'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:support-v13:28.0.0'
    implementation 'com.android.support:support-fragment:28.0.0'
}

All started with implementation of 'com.android.support:support-v4:28.0.0' which wasn't working

Alpha-Centauri
  • 316
  • 2
  • 13

1 Answers1

3
  1. You're either importing a wrong dependency in your (app) build.gradle, or
  2. You've got some DNS problems on your device/network.
  3. You might be able to try this too; Add this to the app build.gradle
repositories {
        maven { url "https://maven.google.com" }
    }

I hope it's either of these because they're easy to solve. Let me know if it got solved.

Edit: add 3

LoopsGod
  • 371
  • 2
  • 11
  • to 1. I added them via Project Strukture search so they are not wrong to 2. I Checkt connection (See above) and I can Donwload the files Manually when chlick on the link to 3. I already did – Alpha-Centauri Jun 12 '19 at 12:01
  • 1
    I've read several cases like this one, it mostly comes down to your native system blocking network requests. Does it work when you go on a different network / turn on firewall? https://stackoverflow.com/questions/45103230/failed-to-resolve-com-android-supportcardview-v726-0-0-android/45342389 – LoopsGod Jun 12 '19 at 14:32
  • I tried an other Network. This is working for me. Pls +1 Question – Alpha-Centauri Jun 13 '19 at 05:32
  • You can set it as the accepted answer. @Alpha-Centauri – LoopsGod Jun 16 '19 at 15:18