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

How to use it on groovy #5

Open
Haocen2004 opened this issue Mar 27, 2023 · 4 comments
Open

How to use it on groovy #5

Haocen2004 opened this issue Mar 27, 2023 · 4 comments

Comments

@Haocen2004
Copy link

I have a project using Groovy which currently doesn't migrate well to kotlin so I try to use the plugin directly
But when I use the script from the readme it returns these

A problem occurred evaluating project ':app'.
> Could not find method materialThemeBuilder() for arguments [build_2r1zpgfyezj6i5x4degpjys53$_run_closure2@4a4ea82] on project ':app' of type org.gradle.api.Project.

Could you please provide an example of groovy?

@Haocen2004
Copy link
Author

Haocen2004 commented Mar 28, 2023

on my another test kotlin project, i got these error

 C:\Users\19811\AndroidStudioProjects\bh3_login_simulation> .\gradlew build                                                                                                                                                           

> Task :buildSrc:compileKotlin
w: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin

> Configure project :app
WARNING:API 'android.registerTransform' is obsolete.
It will be removed in version 8.0 of the Android Gradle plugin.
The Transform API is removed to improve build performance. Projects that use the
Transform API force the Android Gradle plugin to use a less optimized flow for the
build that can result in large regressions in build times. It’s also difficult to
use the Transform API and combine it with other Gradle features; the replacement
APIs aim to make it easier to extend the build without introducing performance or
correctness issues.

There is no single replacement for the Transform API—there are new, targeted
APIs for each use case. All the replacement APIs are in the
`androidComponents {}` block.

The Transform API uses incremental APIs deprecated since Gradle 7.5. Please add
`android.experimental.legacyTransform.forceNonIncremental=true` to
`gradle.properties` to fix this issue. Note that this will run transforms
non-incrementally and may have a build performance impact.
For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
...

WARNING: Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.
e: C:\Users\19811\AndroidStudioProjects\bh3_login_simulation\app\build.gradle.kts:120:1: Unresolved reference: materialThemeBuilder

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\19811\AndroidStudioProjects\bh3_login_simulation\app\build.gradle.kts' line: 120

* What went wrong:
Script compilation error:

  Line 120: materialThemeBuilder {}
            ^ Unresolved reference: materialThemeBuilder

1 error

@Haocen2004
Copy link
Author

Dependency is configured correctly but doesn't work
QQ截图20230402215610

@RikkaW
Copy link
Member

RikkaW commented Apr 2, 2023

Maybe you forgot to apply the plugin?

@Haocen2004
Copy link
Author

Haocen2004 commented Apr 2, 2023

the plugin already applied
Here is the project repository, can you help me to find what I am missing
https://github.com/HonkaiScanner/bh3_login_simulation/tree/dev

I got some example from HideMyAppList, so maybe some unnecessary code

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

2 participants