Gradle assemble error.

Issue #179 new
Tae Hanazono
created an issue

A change is missing to make compiling with API 26 work correctly. The root build.gradle must be changed to this one

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

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

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

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

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

repositories {
    google()
}

I hope that build.gradle is used.

Related links about this issue:

Comments (7)

  1. Martin Felis repo owner

    As for overlooking: nope. I had forgotten to push the change until you mentioned the problem.

    As for the issue: seems to be related to running it from the CLI. When opening the directory using Android Studio it works for me. Though CLI would be much desirable. However even when using your build.gradle from a clean repo I get the following error messages:

     % ./gradlew assemble
    :app:checkDebugClasspath
    :app:preBuild UP-TO-DATE
    :love:preBuild UP-TO-DATE
    :love:preDebugBuild UP-TO-DATE
    :love:checkDebugManifest
    :love:processDebugManifest
    :app:preDebugBuild
    :love:compileDebugAidl NO-SOURCE
    :app:compileDebugAidl NO-SOURCE
    :love:packageDebugRenderscript NO-SOURCE
    :app:compileDebugRenderscript
    :app:checkDebugManifest
    :app:generateDebugBuildConfig
    :app:prepareLintJar
    :app:mainApkListPersistenceDebug
    :app:generateDebugResValues
    :app:generateDebugResources
    :love:compileDebugRenderscript
    :love:generateDebugResValues
    :love:generateDebugResources
    :love:packageDebugResources
    :app:mergeDebugResources
    :app:createDebugCompatibleScreenManifests
    :app:processDebugManifest
    :app:splitsDiscoveryTaskDebug
    :love:generateDebugRFile
    :app:processDebugResources
    :app:generateDebugSources
    :love:generateDebugBuildConfig
    :love:prepareLintJar
    :love:generateDebugSources
    :love:javaPreCompileDebug
    :love:compileDebugJavaWithJavac FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':love:compileDebugJavaWithJavac'.
    > Could not find tools.jar. Please check that /usr/lib/jvm/java-8-openjdk-amd64 contains a valid JDK installation.
    
    * 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
    
    BUILD FAILED in 4s
    23 actionable tasks: 23 executed
    

    Any ideas what the proper way is here?

  2. Tae Hanazono reporter

    That looks like because you're missing JAVA_HOME environment variable and Android Studio ships with their own JDK by default.

    Pada tanggal Sen, 10 Des 2018 05.55, Martin Felis <

  3. Tae Hanazono reporter

    Yep. Build now works correctly. However, there's this problem tho

    D:\Data\Dev\love-11.2\love-android\app\src\main\res\values-w820dp\dimens.xml:5: Error: The dimen "activity_horizontal_margin" in values-w820dp has no declaration in the base values folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier [MissingDefaultResource]
        <dimen name="activity_horizontal_margin">64dp</dimen>
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Not a big deal I guess.

  4. Log in to comment