781flyingdutchman / background_downloader

Flutter plugin for file downloads and uploads
Other
162 stars 76 forks source link

Kotlin 2.0 compilation issue in version 8.7.0 #410

Open hatemragab opened 3 days ago

hatemragab commented 3 days ago

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

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
e: org.jetbrains.kotlin.util.FileAnalysisException: While analysing /Users/hatemragap/.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: /Users/hatemragap/.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.tryCompileIncrementally$lambda$9$compile(IncrementalCompilerRunner.kt:249)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.tryCompileIncrementally(IncrementalCompilerRunner.kt:267)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:120)
    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.DirectMethodHandleAccessor.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Node has already been visited and could result in infinite recursion.

File Path: /Users/hatemragap/.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)
    ... 34 more

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':background_downloader:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Internal compiler error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1
hatemragab commented 3 days ago

please create just empty project and put the last version and try to run or run the example Thanks

781flyingdutchman commented 3 days ago

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.

hatemragab commented 2 days ago

I will check again and provide you example

khaled-0 commented 2 days ago

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
781flyingdutchman commented 2 days ago

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.

khaled-0 commented 1 day ago

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.

781flyingdutchman commented 1 day ago

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.

Abdullah-Mazumder commented 10 hours ago

Screenshot 2024-11-07 172503 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.

781flyingdutchman commented 6 hours ago

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.

781flyingdutchman commented 6 hours ago

@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.

hatemragab commented 6 hours ago

For myside I have updated to background_downloader and now the app can compile successfully Thanks

781flyingdutchman commented 5 hours ago

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?

hatemragab commented 5 hours ago

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