Open hatemragab opened 3 days ago
please create just empty project and put the last version and try to run or run the example Thanks
It works fine on my end - the log refers to a cache file, so perhaps do flutter clean
and also choose Invalidate caches
in Android Studio.
I will check again and provide you example
Fresh CI fails with following error
e: org.jetbrains.kotlin.util.FileAnalysisException: While analysing /home/runner/.pub-cache/hosted/pub.dev/background_downloader-8.7.0/android/src/main/kotlin/com/bbflight/background_downloader/UploadTaskWorker.kt:90:5: java.lang.IllegalArgumentException: Node has already been visited and could result in infinite recursion.
File Path: /home/runner/.pub-cache/hosted/pub.dev/background_downloader-8.7.0/android/src/main/kotlin/com/bbflight/background_downloader/UploadTaskWorker.kt
Variable: <local>.filePathToUse
Declarations:
- com.bbflight.background_downloader.UploadTaskWorker.processBinaryUpload (graph declaration)
- com.bbflight.background_downloader.UploadTaskWorker.kt
- com.bbflight.background_downloader.UploadTaskWorker
at org.jetbrains.kotlin.util.AnalysisExceptionsKt.wrapIntoFileAnalysisExceptionIfNeeded(AnalysisExceptions.kt:57)
at org.jetbrains.kotlin.fir.FirCliExceptionHandler.handleExceptionOnFileAnalysis(Utils.kt:249)
at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:46)
at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.resolveAndCheckFir(firUtils.kt:77)
at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.buildResolveAndCheckFirViaLightTree(firUtils.kt:88)
at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModuleToAnalyzedFir(jvmCompilerPipeline.kt:319)
at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModulesUsingFrontendIrAndLightTree(jvmCompilerPipeline.kt:118)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:148)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:103)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:49)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:464)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:73)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:506)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:423)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:301)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:129)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:675)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:92)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1660)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalArgumentException: Node has already been visited and could result in infinite recursion.
File Path: /home/runner/.pub-cache/hosted/pub.dev/background_downloader-8.7.0/android/src/main/kotlin/com/bbflight/background_downloader/UploadTaskWorker.kt
Variable: <local>.filePathToUse
Declarations:
- com.bbflight.background_downloader.UploadTaskWorker.processBinaryUpload (graph declaration)
- com.bbflight.background_downloader.UploadTaskWorker.kt
- com.bbflight.background_downloader.UploadTaskWorker
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.processUnionNode$reportErrorsOnInitializationsInInputs(VariableInitializationCheckProcessor.kt:106)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.processUnionNode$reportErrorsOnInitializationsInInputs(VariableInitializationCheckProcessor.kt:114)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.processUnionNode(VariableInitializationCheckProcessor.kt:126)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.runCheck(VariableInitializationCheckProcessor.kt:69)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.processSubGraphs(VariableInitializationCheckProcessor.kt:224)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.runCheck(VariableInitializationCheckProcessor.kt:82)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.processSubGraphs(VariableInitializationCheckProcessor.kt:224)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.runCheck(VariableInitializationCheckProcessor.kt:82)
at org.jetbrains.kotlin.fir.analysis.cfa.VariableInitializationCheckProcessor.check(VariableInitializationCheckProcessor.kt:46)
at org.jetbrains.kotlin.fir.analysis.cfa.FirPropertyInitializationAnalyzer.analyze(FirPropertyInitializationAnalyzer.kt:33)
at org.jetbrains.kotlin.fir.analysis.collectors.components.ControlFlowAnalysisDiagnosticComponent.analyze(ControlFlowAnalysisDiagnosticComponent.kt:53)
at org.jetbrains.kotlin.fir.analysis.collectors.components.ControlFlowAnalysisDiagnosticComponent.visitSimpleFunction(ControlFlowAnalysisDiagnosticComponent.kt:92)
at org.jetbrains.kotlin.fir.analysis.collectors.components.ControlFlowAnalysisDiagnosticComponent.visitSimpleFunction(ControlFlowAnalysisDiagnosticComponent.kt:27)
at org.jetbrains.kotlin.fir.declarations.FirSimpleFunction.accept(FirSimpleFunction.kt:51)
at org.jetbrains.kotlin.fir.analysis.collectors.CheckerRunningDiagnosticCollectorVisitor.checkElement(CheckerRunningDiagnosticCollectorVisitor.kt:24)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.access$checkElement(AbstractDiagnosticCollectorVisitor.kt:30)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithDeclarationAndReceiver(AbstractDiagnosticCollectorVisitor.kt:1376)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitSimpleFunction(AbstractDiagnosticCollectorVisitor.kt:118)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitSimpleFunction(AbstractDiagnosticCollectorVisitor.kt:30)
at org.jetbrains.kotlin.fir.declarations.FirSimpleFunction.accept(FirSimpleFunction.kt:51)
at org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl.acceptChildren(FirRegularClassImpl.kt:63)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithDeclarationAndReceiver(AbstractDiagnosticCollectorVisitor.kt:311)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitClassAndChildren(AbstractDiagnosticCollectorVisitor.kt:87)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:92)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:30)
at org.jetbrains.kotlin.fir.declarations.FirRegularClass.accept(FirRegularClass.kt:48)
at org.jetbrains.kotlin.fir.declarations.impl.FirFileImpl.acceptChildren(FirFileImpl.kt:57)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:1151)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:30)
at org.jetbrains.kotlin.fir.declarations.FirFile.accept(FirFile.kt:42)
at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector.collectDiagnostics(AbstractDiagnosticCollector.kt:36)
at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:34)
... 35 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':background_downloader:compileProfileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Internal compiler error. See log for more details
Weird. Does anyone else get this error? Are you using Kotlin 1.9.20? The logs suggest an issue with the compiler that somehow I am not experiencing.
Weird. Does anyone else get this error? Are you using Kotlin 1.9.20? The logs suggest an issue with the compiler that somehow I am not experiencing.
It seems to work when I downgrade to 1.9.20 however flutter's default kotlin version is 2.0.20 So I believe you should investigate and port it to latest version.
I believe the Kotlin 2 compiler is still going through some evolution, and this error is an example why. For now, per the plugin doc, please use Kotlin 1.9.20.
I am getting this error. i have tried with 1.9.10 kotlin version. but still it is not compiling. is there any way to fix this.
I am getting this error. i have tried with 1.9.10 kotlin version. but still it is not compiling. is there any way to fix this.
Per the docs, use Kotlin 1.9.20. The plugin use the Serialization plugin, which was not included in 1.9.10.
@hatemragab and @khaled-0 can you try using branch 'kotlin2' to see if that fixes the problem? Change your pubspec.yaml entry to:
background_downloader:
git:
url: https://github.com/781flyingdutchman/background_downloader.git
ref: kotlin2
and see if it compiles and runs in a new project on your setup. Please let me know, if so I'll push it as a minor update.
For myside I have updated to background_downloader and now the app can compile successfully Thanks
I have updated to background_downloader and now the app can compile successfully
Just to confirm: the kotlin2
branch works for you with Kotlin 2?
I have updated to background_downloader and now the app can compile successfully
Just to confirm: the
kotlin2
branch works for you with Kotlin 2?
Yes 100% when it will be avalible for pub dev please
This error happens only after upgrade from v ^8.6.0 to ^8.7.0 the package works good if i locked the version as
background_downloader: 8.6.0