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

NoClassDefFoundError with Gradle 5.0 #9

Closed
jmccance opened this issue Nov 28, 2018 · 5 comments
Closed

NoClassDefFoundError with Gradle 5.0 #9

jmccance opened this issue Nov 28, 2018 · 5 comments
Assignees

Comments

@jmccance
Copy link

Seeing a NoClassDefFoundError when trying to run under Grade 5.0. Looks like AbstractProvider was removed or renamed somewhere between 4.10.2 and 5.0.

These also appear to be unstable/internal APIs even in 5.0, so it might be worth exploring an alternative approach.

https://gist.github.com/jmccance/b9cf65834de2c4fbd82effc5c7728d86

@stewartbryson
Copy link

I'm seeing this as well.

@BreadMoirai BreadMoirai self-assigned this Dec 6, 2018
@xeruf
Copy link

xeruf commented Dec 14, 2018

Same here, this is urgent! It prevents me from upgrading everything to gradle 5.0!

@akasolace
Copy link

akasolace commented Dec 20, 2018

I observe something strange (at least to me). I tried to use the plugin in 2 ways:

**option 1) **

apply plugin: 'com.github.breadmoirai.github-release'
githubRelease {

    def _token = GITHUB_TOKEN 
    owner = xxx
    repo = xxx
    releaseAssets.from("$target_dir")

    body {
        token = _token
        if (releaseArtefacts) {
            if (development_stage == '0') {
                tagName = "DEV"
                releaseName = "DEV"
                targetCommitish = "master"
                body = "Latest development version (aimed at developers).\nBuild ... Release on ...."
                prerelease = true
                overwrite = false
                println("DEVELOPMENT version has been released on GitHub")
            } else if (development_stage == '1') {
                tagName = "BETA"
                releaseName = "BETA"
                targetCommitish = "master"
                body = "..................."
                prerelease = true
                overwrite = true
                println("BETA version has been released on GitHub.\nBuild ... Release on ....")
            } 
        }
    }}

this fails with the following error:

FAILURE: Build failed with an exception.
What went wrong: okhttp3/OkHttpClient
Exception is: java.lang.NoClassDefFoundError: okhttp3/OkHttpClient

option 2 (the one I would eventually like to use, i.e use plugin only if certain requirements are met):

task ReleaseToGitHub() {
    group 'tool'

    if (releaseArtefacts && ['0', '1''].contains(development_stage) && upstreamFixed) {
        println("I apply")
        apply plugin: 'com.github.breadmoirai.github-release'
        githubRelease {

            def _token = GITHUB_TOKEN  // required token for your personal access with repo permissions
            owner = 'akasolace'
            repo = 'HO'

            println("$target_dir")
            releaseAssets.from("$target_dir")
            println(releaseAssets)

            body {
                token = _token
                if (releaseArtefacts) {
                    if (development_stage == '0') {
                        tagName = "DEV"
                        releaseName = "DEV"
                        targetCommitish = "master"
                        body = "Latest development version (aimed at developers).\nBuild ... Release on ...."
                        prerelease = true
                        overwrite = false
                    } else {
                        tagName = "BETA"
                        releaseName = "BETA"
                        targetCommitish = "master"
                        body = "..................."
                        prerelease = true
                        overwrite = true
                    }  }  }  }  }}

in that case the task is running without error, it goes though the statement but does not do anything

Could you please tell me what I am doing wrong?
Thank you

@BreadMoirai BreadMoirai mentioned this issue Jan 6, 2019
@BreadMoirai
Copy link
Owner

@akasolace Try adding this to the top of your build file

buildscript {
  repositories {
    jcenter()
  }
} 

@akasolace
Copy link

akasolace commented Jan 6, 2019

I already have a
repositories { jcenter() }

if I enclose it into a buildscript block then it breaks
if I simply add that extra block it does not change anything. I have the same behaviour as the one described above.

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

5 participants