org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method compile() for arguments [me.leolin:ShortcutBadger:1.1.22#aar] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Related
I want Ask for this error on build app android studio
Build file 'D:\HeavenChat\app\build.gradle' line: 42
A problem occurred evaluating project ':app'.
> Could not find method dependenciesInfo() for arguments [build_7y5lyogygw0o15evziajfhwsr$_run_closure1$_closure8#36f10fd8] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
SpringBoot + Vue project, gradle build error:
Execution failed for task ':nodeSetup'.
Could not find method layout() for arguments [pattern, com.moowork.gradle.node.task.SetupTask$_addRepository_closure5$_closure7#185cb06f] on object of type org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository.
Cause: There is a breaking change in gradle 6.8 which is you can checkout here:
https://docs.gradle.org/current/userguide/upgrading_version_6.html#configuring_the_layout_of_an_ivy_repository
"The 'layout' method taking a configuration block has been removed and is replaced by 'patternLayout'.
Check this here.
In gradle script I can do sourceSets.main.runtimeClasspath to get the runtime classpath. But in kts script it complains
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val NamedDomainObjectContainer<Configuration>.runtimeClasspath: NamedDomainObjectProvider<Configuration> defined in org.gradle.kotlin.dsl
How can I do it in kts script?
It turns out that I need sourceSets["main"].runtimeClasspath . Not sure if it is the most idiomatic way
I have updated ByteBuddy Gradle plugin to the version 1.11.18.
Unlikely the previous version, where I could set up byteBuddy.transform.plugin as a string, in the latest version I have to set it up as a class.
Cannot cast object 'com.test.PluginImpl.class' with class 'java.lang.String' to class 'java.lang.Class' due to: java.lang.ClassNotFoundException: com.test.PluginImpl.class
I'm trying to figure out how to get the plugin applied
I followed the readme (https://github.com/raphw/byte-buddy/tree/master/byte-buddy-gradle-plugin#buildgradle):
byteBuddy {
transformation {
plugin = com.test.PluginImpl.class
}
}
However, I've got the error:
* What went wrong:
A problem occurred evaluating root project 'Test'.
> Could not get unknown property 'com' for object of type net.bytebuddy.build.gradle.Transformation.
Did you add the plugin to the buildsource? Groovy is a bit guessy when it comes to these things. Also try importing the class and using the unqualified name.
The old approach did no longer work properly with newer Gradle versions which is why I had to redo it.
I admit I am quite new to gradle but I did not expect to be unable to understand something as simple as the example below. I can read the gradle documentation about checking whether a project property have been set or not using a hasProperty(String propertyName) call and I am sitting here and have no idea why something so basic does not work.
I believe my mind must be so much "ant like" oriented that for sure I am missing something ordinary basic
task printSystem() << {
println system
println "has property: " + hasProperty("system")
}
and invoking that task with the command below:
$gradle printSystem -Psystem=mySystem
mySystem
has property: null
So my questions would be:
Why system is printed out but hasProperty returns null?
How should I check for the existence of the project property called "system"?
Is there a different way for testing for a project property as opposed to a system property?
How would you pass a system property from the command line?
This is from, the gradle documentation and I believe I am reading it right
19.2.1. Checking for project properties
You can access a project property in your build script simply by using its name as you would use a variable. If this property does not exist, an exception will be thrown and the build will fail. If your build script relies on optional properties the user might set, perhaps in a gradle.properties file, you need to check for existence before you access them. You can do this by using the method hasProperty('propertyName') which returns true or false.
You need to explicitly invoke hasProperty on the project instance - without it, hasProperty is invoked on some local context. The following example works:
task printSystem() << {
println system
println "has property: " + project.hasProperty("system")
}
Because non-existing properties (system is not defined in the script) are taken from the project instance. If you won't pass the system property, an exception will be thrown on println.
project.hasProperty('propName')
Not sure if I understood right, but you can access project properties via the project instance and system properties via the System class.
Using -D switch - gradle -Dprop=value