google / flexbox-layout

Flexbox for Android
Apache License 2.0
18.22k stars 1.79k forks source link

Playground doesn't build in latest Android Studio Flamingo #625

Open phazei opened 1 year ago

phazei commented 1 year ago

Issues and steps to reproduce

Install Android Studio Flamingo, choose new project from version control, attempt to build.

Expected behavior

Builds

Version of the flexbox library

3.0.0

Actual Behavior

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Unsupported Java. Your build is currently configured to use Java 17.0.6 and Gradle 6.7.1.

Possible solution:

Also, does this repo have no more love from google? Is there anyone even looking at this repo from google? So many issues and PR's without a single response from any repo manager for years, sad. @thagikura

ALEX5402 commented 1 year ago

At first go to your project gradle/wrapper directiory and then gradle-wrapper.properties go to this file into that folder and upgrade the gradle version to 7.4 or higher like

i was using gradle 8.0 so i was using this

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

and if you want to use gradle 7.2 then use this

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

and if you are you using this kind of build.gradle then change the gradle version 6.7.1 to 7.2.0

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:6.7.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

after all of that just sync the project

ayounas02 commented 10 months ago

I added these lines in gradle to solve the issue

maven { url 'https://dl.bintray.com/android/android-tools' }

ALEX5402 commented 9 months ago

no sir this won't work