Open zhonghanwen opened 5 years ago
I'm having the same problem
i'm having the same problem
You should use play-services-auth version 15.0.0
I found the way how to bypass this error. The problem is inside your plugin. Instead of using your plugin use this one: https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx
You have too add resolutionStrategy when it comes to aspect version. Your build.gradle root:
repositories {
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'org.aspectj:aspectjtools') {
details.useVersion '1.9.2'
}
if (requested.group == 'org.aspectj:aspectjrt') {
details.useVersion '1.9.2'
}
Now everything is working with play-services-auth:15.0.0 I know this is not a fix but maybe it will help you to come across some idea. Hope this helps. I am still investigating what is the cause of that error.
Filter your classpath from excess dependencies. It helps me:
val javaCompiler = variant.javaCompiler as AbstractCompile
javaCompiler.doLast {
val args = arrayOf(
"-showWeaveInfo",
"-1.5",
"-inpath", javaCompiler.destinationDir.toString(),
"-aspectpath", javaCompiler.classpath.asFileTree.filter {
!it.canonicalPath.contains("transforms")
}.asPath,
"-d", javaCompiler.destinationDir.toString(),
"-classpath", javaCompiler.classpath.asPath,
"-bootclasspath", (project.extensions.getByName("android") as BaseExtension).bootClasspath.joinToString(File.pathSeparator)
)
val handler = MessageHandler(true)
Main().run(args, handler)
}
I'm having the same problem
@JakeWharton any news on this? This bug means that Hugo won't work with the latest play-services-auth
library.
For aspectpath
is enough just path to libs of plugin for example in case of the plugin:
JavaCompile javaCompiler
if (variant.hasProperty('javaCompileProvider')) {
// Android 3.3.0+
javaCompiler = variant.javaCompileProvider.get()
} else {
javaCompiler = variant.javaCompile
}
javaCompiler.doLast {
def aspectPath = javaCompile.classpath.asFileTree.filter {
it.canonicalPath.contains("hugo-runtime") || it.canonicalPath.contains("hugo-annotations")
}.asPath
val args = [
"-showWeaveInfo",
"-1.8",
"-inpath", javaCompiler.destinationDir.toString(),
"-aspectpath", aspectPath,
"-d", javaCompiler.destinationDir.toString(),
"-classpath", javaCompiler.classpath.asPath,
"-bootclasspath", project.android.bootClasspath.join(File.pathSeparator)
]
val handler = MessageHandler(true)
Main().run(args, handler)
}
this work for me , exclude all play-servcie.jar
JavaCompile javaCompile = variant.javaCompile
javaCompile.doLast {
def aspectPath = javaCompile.classpath.asFileTree.filter { !(it.canonicalPath.contains("play-services") && !it.canonicalPath.contains("jetified-play-services")) }.asPath;
String[] args = [
"-showWeaveInfo",
"-1.8",
"-inpath", javaCompile.destinationDir.toString(),
"-aspectpath", aspectPath,
"-d", javaCompile.destinationDir.toString(),
"-classpath", aspectPath,
"-bootclasspath", project.android.bootClasspath.join(File.pathSeparator)
]
log.debug "aspectj args: " + Arrays.toString(args)
MessageHandler handler = new MessageHandler(true);
new Main().run(args, handler)
for (IMessage message : handler.getMessages(null, true)) {
switch (message.getKind()) {
case IMessage.ABORT:
case IMessage.ERROR:
case IMessage.FAIL:
log.error message.message, message.thrown
break
case IMessage.WARNING:
log.warn message.message, message.thrown
break
case IMessage.INFO:
log.info message.message, message.thrown
break
case IMessage.DEBUG:
log.debug message.message, message.thrown
break
}
}
}