Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed to resolve: com.github.AsynctaskCoffee:VideoLayout:1.0 #3

Closed
emailsubjekt opened this issue Oct 1, 2019 · 21 comments
Closed

Comments

@emailsubjekt
Copy link

emailsubjekt commented Oct 1, 2019

I added your library to gradle
implementation 'com.github.AsynctaskCoffee:VideoLayout:1.0'
and in build gradle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }

}

and got this error

ERROR: Failed to resolve: com.github.AsynctaskCoffee:VideoLayout:1.0

@emailsubjekt
Copy link
Author

Nevermind, it needed to be in the bottom repositories

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

buildscript {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    
    // 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' }

}

}

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

@AsynctaskCoffee
Copy link
Owner

I think you solved your issue without my help :) I am so sorry for not replying it earlier. Enjoy :)

@Clopma
Copy link

Clopma commented Sep 21, 2021

I have the same problem and I don't understand what 'in the bottom repositories' means.

@AsynctaskCoffee
Copy link
Owner

Add maven { url 'https://jitpack.io' } into gradle and make sure you have internet connection while sync

@Clopma
Copy link

Clopma commented Sep 21, 2021

It is not working. I don't have much experience with gradle. I have build.gradle (project):

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.2"
    }
}

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

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

Then, in the build.gradle (module) file i have:

dependencies {
    implementation 'com.github.AsynctaskCoffee:VideoLayout:1.3'
}

I also had to change settings.gradle file from RepositoriesMode.FAIL_ON_PROJECT_REPOS to RepositoriesMode.PREFER_SETTINGS

It is syncing and building ok but It is not detecting the dependency:

image

@AsynctaskCoffee
Copy link
Owner

AsynctaskCoffee commented Sep 21, 2021

I think you missed buildscript -> repositories part.

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.2"
    }
}

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

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

try this and let me know I am here for a while lets fix this issue :)

@Clopma
Copy link

Clopma commented Sep 21, 2021

First of all, thank you very much for your help.

Well, it is not there at the top because I deleted it a while ago trying things, but yes, that was my first approach. I just replaced all the file with that code you just posted but it didn't fix it. Any ideas?

@Clopma
Copy link

Clopma commented Sep 21, 2021

image

@AsynctaskCoffee
Copy link
Owner

AsynctaskCoffee commented Sep 21, 2021

Did you activate offline grade ?

Check;
https://stackoverflow.com/a/31235328/13706694

If yes you have to disable it.

@Clopma
Copy link

Clopma commented Sep 21, 2021

I don't have that setting under properties
image
There's the offline mode toggle button on the gradle tab, which it's not activated:
image
Also I have other dependencies (not maven) that worked fine so I think it is not a connectivity thing.

@Clopma
Copy link

Clopma commented Sep 21, 2021

Ok I fixed it

(editing)

@AsynctaskCoffee
Copy link
Owner

Can you send me the gradle files via mail ? Or if your project public could you send me the access ?

@AsynctaskCoffee
Copy link
Owner

Ok I fixed it

(editing)

tu est parfait 🚀 🎸 Lets share it for help to other I also wonder the solution 🦖

@AsynctaskCoffee
Copy link
Owner

Then I'm closing this issue in your honor. Happy coding.

@Clopma
Copy link

Clopma commented Sep 21, 2021

Ok I think I went too quick... For a moment the error disapeared but It was not fixed just reloading I'm sorry 😢 I will keep trying and see what happend exactly.

@AsynctaskCoffee
Copy link
Owner

Lets send me the code via GitHub I will check is there any gradle problem.

@Clopma
Copy link

Clopma commented Sep 21, 2021

Ok, I just created a repo
https://github.com/Clopma/ChupitoGratisApp

The layout is in activity_login.xml

@AsynctaskCoffee
Copy link
Owner

AsynctaskCoffee commented Sep 21, 2021

image

image

image

image

image



apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.carloslopezmari.myapplication"
        minSdkVersion 26
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        resConfigs "en", "US"
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildFeatures {
        viewBinding true
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.android.volley:volley:1.2.1'
    implementation 'com.shuhart.stepview:stepview:1.5.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'com.github.AsynctaskCoffee:VideoLayout:1.6'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

and

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

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

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

Enjoy ✨

@AsynctaskCoffee
Copy link
Owner

As I saw there is a lot of typos in ur gradle. I hope it works 👓

@Clopma
Copy link

Clopma commented Sep 21, 2021

Oh It worked, thank you very much!

I tried every one of your changes separately and what mattered at the end was deleting the dependencyResolutionManagement from setting.gradle, I don't know exactly why but that was causing it to break!
image

Thank you very much again for your time!

@AsynctaskCoffee
Copy link
Owner

You are welcome my friend 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants