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

Android build broken #2837

Closed
consp1racy opened this issue Jun 10, 2018 · 4 comments
Closed

Android build broken #2837

consp1racy opened this issue Jun 10, 2018 · 4 comments

Comments

@consp1racy
Copy link

1. Build log from https://jitpack.io

Good log from when it was working as expected:

https://jitpack.io/com/github/consp1racy/android-support-preference/0ee2218c30/build.log

Bad log from yesterday:

https://jitpack.io/com/github/consp1racy/android-support-preference/6a49f49427/build.log

2. Does the project build on your machine?

Yes.

Thanks for looking into this.

@oshamahue
Copy link

@jitpack-io
Copy link
Member

Hi @consp1racy @oshamahue

You might need to add the google repository if you haven't already:

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

For reference the error was:

Could not find common.jar (android.arch.core:common:1.1.0).
           Searched in the following locations:
               https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

@consp1racy
Copy link
Author

Hi,

in all the modules and the build script there is at least

repositories {
    jcenter()
    google()
}

so if you're relying on people having dependencies in allprojects, don't.

Can you think of anything else?

@consp1racy
Copy link
Author

consp1racy commented Jun 12, 2018

Here's what I see:

Good

Getting a list of gradle tasks
0m4.947s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
Running: ./gradlew clean -Pgroup=com.github.consp1racy -Pversion=0ee2218c30 -xtest -xlint build publishToMavenLocal
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all

Bad

Getting a list of gradle tasks
0m4.480s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all

FAILURE: Build failed with an exception.

* Where:
Script '/home/jitpack/build/android-tasks.gradle' line: 11

* What went wrong:
A problem occurred configuring project ':support-preference'.
> Could not resolve all dependencies for configuration ':support-preference:debugCompileClasspath'.
   > A problem occurred configuring project ':support-spinner'.
      > Could not resolve all files for configuration ':support-spinner:debugCompileClasspath'.
         > Could not find common.jar (android.arch.core:common:1.1.0).
           Searched in the following locations:
               https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
See the documentation and examples: https://jitpack.io/docs/

Adding maven plugin
Found android library build file in support-preference-color
Found android library build file in support-spinner
Found android library build file in support-preference
Running: ./gradlew clean -Pgroup=com.github.consp1racy -Pversion=6a49f49427 install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
Download https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/2.0/android-maven-gradle-plugin-2.0.pom
Download https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/2.0/android-maven-gradle-plugin-2.0.jar

Fix

So I updated the Android Maven Publish plugin from 3.3.0 to 3.6.0 and it works now.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0' // 1.8.1 is broken with Gradle 4.7.
        classpath 'digital.wup:android-maven-publish:3.6.0'
    }
}

If you checkout the release notes you'll see that Gradle 4.7 support was added in AMP 3.5.0. Curiously the good build worked with AMP 3.3.0.

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