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

gradle-6.5 --> gradle-8.2.1 #137

Merged
merged 2 commits into from
Aug 20, 2023

Conversation

soloturn
Copy link
Contributor

@soloturn soloturn commented Jul 8, 2023

@jdrueckert
Copy link
Member

jdrueckert commented Jul 12, 2023

There's a bunch of additional stuff that @keturn did in #136 ... we might want to consider adopting those changes, or reopening #136 and integrating the changes of this PR in there.
Edit: likely those changes are automatically generated/updated by gradle - I just don't know how to trigger that 🤔 Using gradlew after updating the version in gradlew-wrapper.properties didn't...

@BenjaminAmos
Copy link
Contributor

The gradlew wrapper command updates the gradle wrapper files, including the gradlew and gradlew.bat scripts.

Copy link
Contributor

@BenjaminAmos BenjaminAmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start but it fails when the Android libraries are enabled:

> gradlew
FAILURE: Build failed with an exception.

* Where:
Build file 'gestalt-android/build.gradle' line: 60

* What went wrong:
A problem occurred evaluating project ':gestalt-android'.
> Could not set unknown property 'classifier' for task ':gestalt-android:androidJavadocsJar' of type org.gradle.api.tasks.bundling.Jar.

To enable the Android libraries, you need to make sure you have the Android SDK downloaded and then run echo sdk.dir=<SDK_ROOT> > local.properties (where <SDK_ROOT> is the path to the Android SDK).

@jdrueckert
Copy link
Member

Could not set unknown property 'classifier' for task ':gestalt-android:androidJavadocsJar' of type org.gradle.api.tasks.bundling.Jar

That sounds like the thing I also ran into... @BenjaminAmos made me aware of the fact that classifier was renamed to archiveClassifier

unit tests still run. for android, classifier got changed to archiveClassifier.
@soloturn
Copy link
Contributor Author

thank you @jdrueckert, this error is gone now . @BenjaminAmos i set the path to the sdk and now it fails

❯ gradle --stacktrace
A problem occurred configuring project ':gestalt-android'.
> Failed to notify project evaluation listener.
   > org/gradle/api/plugins/MavenPlugin
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':gestalt-android'.
...
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:111)
...
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/plugins/MavenPlugin
        at com.android.build.gradle.internal.variant.VariantHelper.setupArchivesConfig(VariantHelper.java:47)
        at com.android.build.gradle.internal.LibraryTaskManager.createBundleTask(LibraryTaskManager.java:420)
        at com.android.build.gradle.internal.LibraryTaskManager.doCreateTasksForVariant(LibraryTaskManager.java:349)
        at com.android.build.gradle.internal.TaskManager.createTasksForVariant(TaskManager.java:487)
        at com.android.build.gradle.internal.TaskManager.createTasks(TaskManager.java:405)
        at com.android.build.gradle.internal.plugins.BasePlugin.createAndroidTasks(BasePlugin.java:595)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:82)
        at com.android.build.gradle.internal.plugins.BasePlugin.lambda$createTasks$10(BasePlugin.java:498)
        at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt:37)
        at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
        at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.run(DefaultListenerBuildOperationDecorator.java:171)

i tried as well to get hints in the gradle discussion forum: https://discuss.gradle.org/t/gradle-6-8-2-gradle-8-2-1-java-lang-noclassdeffounderror-org-gradle-api-plugins-mavenplugin/46074

@BenjaminAmos
Copy link
Contributor

@soloturn
Is the Android Gradle Plugin version possibly too old now? 4.1.3 was designed to go with Gradle 6.5, so newer versions of Gradle might have broken things. You could try updating to a newer version of the android gradle plugin, maybe 7.4.1? It looks like versions 8.0 and above require Java 17, which isn't usable for us whilst we're still building with Java 11.

gestalt/build.gradle

Lines 12 to 14 in 911728e

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

@jdrueckert jdrueckert changed the title gradle-6.5 --> gradle-8.2 gradle-6.5 --> gradle-8.2.1 Jul 30, 2023
@BenjaminAmos BenjaminAmos merged commit 17ab4d3 into MovingBlocks:develop Aug 20, 2023
@BenjaminAmos
Copy link
Contributor

This was finished off by #139. Thanks @soloturn!

@soloturn soloturn deleted the upgrade-gradle branch September 17, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

upgrade to gradle 6.9.x (prep for gradle 7.x)
4 participants