java.lang.IllegalStateException: Expecting .,<, or ;, but found firebaseperf while unpacking

拥有回忆 提交于 2019-12-10 16:07:30

问题


After integrating the performance sdk in my app, gradle is printing the following warning while building the project:

java.lang.IllegalStateException: Expecting .,<, or ;, but found firebaseperf while unpacking ;BuilderType:Lcom/google/android/gms/internal/firebase-perf/zzam;>Ljava/lang/Object;Lcom/google/android/gms/internal/firebase-perf/zzdf;

Though it's not failing the build, I am not sure what does this mean and therefore don't want to push this into production until I am sure that it won't cause any problem.

Can anyone please help here?

Performance sdk version: 15.2.0

Firebase core version: 15.0.2

回答1:


I ran into this myself with a separate project. You can modify the classpath that is passed to hugo's plugin to omit the firebase-perf module itself.

    def filtered_class_filetree = javaCompile.classpath.asFileTree.filter {
        !it.canonicalPath.contains("firebase-perf")
    }

I'm assuming this happens because Google/Firebase modified the original aspect compiler to support other functionality, thus running the normal ACJ compiler over it makes it crap out.




回答2:


In my case it is because of conflict plugins my project has

classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'

apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.jakewharton.hugo'


compile 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-perf:16.0.0'

I tried to reproduce it on blank project and after removing the hugo, the issue fixed, this is the previous log snippet from mine

java.lang.IllegalStateException: Expecting .,<, or ;, but found firebaseperf while unpacking <MessageType:Lcom/google/android/gms/internal/firebase-perf/zzal<TMessageType;TBuilderType;>;BuilderType:Lcom/google/android/gms/internal/firebase-perf/zzam<TMessageType;TBuilderType;>;>Ljava/lang/Object;Lcom/google/android/gms/internal/firebase-perf/zzdf;
    at org.aspectj.util.GenericSignatureParser.parseClassTypeSignature(GenericSignatureParser.java:221)
    at org.aspectj.util.GenericSignatureParser.parseFieldTypeSignature(GenericSignatureParser.java:155)
    at org.aspectj.util.GenericSignatureParser.parseFormalTypeParameter(GenericSignatureParser.java:130)
    at org.aspectj.util.GenericSignatureParser.parseAsClassSignature(GenericSignatureParser.java:51)
    at org.aspectj.weaver.UnresolvedType.forGenericTypeSignature(UnresolvedType.java:274)
    at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:482)

Hopefully can help fixed your issue




回答3:


This is an issue with the latest version of firebase performance library and aspectJ - i imagine they are doing some aspect weaving and your project also does weaving. If it's the hugo library like some other people posted i'd recommend removing it since it's a very old library and breaks incremental builds in android.

You shouldn't need hugo, since it's just for debug logging and the damage it does your builds - and it not supporting kotlin - should be reason enough to phase it out.

I - having fixed the kotlin issue with aspectJ - have a project that does need weaving and got this error hen upgrading firebase. Fixed by filtering out non-project classes from weaving like this in my build script:

String[] javaArgs = ["-showWeaveInfo",
                                 "-1.8",
                                 "-inpath", javaCompile.destinationDir.toString(),
                                 "-aspectpath", javaCompiler.classpath.asFileTree.filter {
                !it.canonicalPath.contains("transforms")
            }.asPath,
                                 "-d", javaCompile.destinationDir.toString(),
                                 "-classpath", javaCompile.classpath.asPath,
                                 "-bootclasspath", project.android.bootClasspath.join(
                    File.pathSeparator)]

AspectJ weaving worked again and I was able to use the latest firebase.




回答4:


I encountered the same problem and I fix with File > Invalide Caches / Restart... Hope this will be useful for you.



来源:https://stackoverflow.com/questions/50504933/java-lang-illegalstateexception-expecting-or-but-found-firebaseperf-whi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!