0

I am getting a build failed with following exception, not able to understand what is wrong in following code. can anybody help me with this. Its builds well when i run on my laptop, but fails in my CI pipeline in azure devOps.

2022-12-14T07:21:42.4290976Z > Task :app:compileDebugKotlin FAILED
2022-12-14T07:21:42.4291871Z e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (3102,29) in /home/vsts/work/1/s/app/src/main/java/com/bfl/superapp/hybrid/HWWebChromeClient.kt
2022-12-14T07:21:42.4292480Z 
2022-12-14T07:21:42.4292887Z Attachments:
2022-12-14T07:21:42.4293323Z expression.kt
2022-12-14T07:21:42.4293754Z for (i in 0..sizeDetails){
2022-12-14T07:21:42.4294274Z                             if(cart_details.get(i).appId.equals(appId)){
2022-12-14T07:21:42.4294825Z                                 appidfound = true
2022-12-14T07:21:42.4295294Z                                 cartDetailsNew.appId = appId
2022-12-14T07:21:42.4295914Z                                 cartDetailsNew.resumeFlag = cart_details.get(i).resumeFlag
2022-12-14T07:21:42.4296523Z                                 cartDetailsNew.mobileNo = cart_details.get(i).mobileNo
2022-12-14T07:21:42.4297114Z                                 cartDetailsNew.prod = cart_details.get(i).prod
2022-12-14T07:21:42.4297703Z                                 cartDetailsNew.prodProps = cart_details.get(i).prodProps
2022-12-14T07:21:42.4298282Z                                 cartDetailsNew.channel = cart_details.get(i).channel
2022-12-14T07:21:42.4298864Z                                 if(cms_cartData != null && cms_cartData.size > 0) {
2022-12-14T07:21:42.4299684Z                                     val sizeData = cms_cartData.size - 1
2022-12-14T07:21:42.4300215Z                                     for (k in 0..sizeData) {
2022-12-14T07:21:42.4300763Z                                         if (cart_details.get(i).prod == cms_cartData.get(k).prodcode) {
2022-12-14T07:21:42.4301336Z                                             cartDetailsNew.appLink =
2022-12-14T07:21:42.4301882Z                                                 cms_cartData.get(k).in_app_link.toString()
2022-12-14T07:21:42.4302394Z                                             cartDetailsNew.img =
2022-12-14T07:21:42.4302931Z                                                 cms_cartData.get(k).imagelink.toString()
2022-12-14T07:21:42.4303448Z                                             cartDetailsNew.prodDesc =
2022-12-14T07:21:42.4303992Z                                                 cms_cartData.get(k).proddesc.toString()
2022-12-14T07:21:42.4339094Z                                         }
2022-12-14T07:21:42.4339718Z                                     }
2022-12-14T07:21:42.4340431Z                                 }
2022-12-14T07:21:42.4340863Z                                 break
2022-12-14T07:21:42.4341290Z                             }
2022-12-14T07:21:42.4341560Z 
2022-12-14T07:21:42.4341959Z                             }
2022-12-14T07:21:42.4342663Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
2022-12-14T07:21:42.4343675Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
2022-12-14T07:21:42.4344545Z    at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
2022-12-14T07:21:42.4345373Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
2022-12-14T07:21:42.4346363Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:147)
2022-12-14T07:21:42.4347441Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeOfLastExpressionInBlock(ExpressionTypingServices.java:406)
2022-12-14T07:21:42.4348430Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedTypeWithWritableScope(ExpressionTypingServices.java:327)

When I try to build same code on my laptop it works, it fails intermittently only on DeoOps pipeline.

Here is the pipeliye yml code

trigger:

  • develop

name: $(Build.DefinitionName)_$(Date:yyyyMMdd)BuildNo$(Rev:_rr)

jobs:

  • job: Build_Application_binary pool: vmImage: 'ubuntu-latest' displayName: 'Build native Android App' steps:

    • template: pipelinesteps/copy_pwa_dist.yml
    • template: pipelinesteps/gradle_build.yml
    • template: pipelinesteps/download_keystore_file.yml
    • template: pipelinesteps/sign_aab_file.yml
    • template: pipelinesteps/copy_files_to_artifactory.yml
  • job: Publish_to_AppCenter pool: vmImage: 'ubuntu-latest' displayName: 'Publish to AppCenter' dependsOn: Build_Application_binary condition: succeeded() steps:

    • template: pipelinesteps/publish_to_appcenter.yml

and here is the Gradle Task pipeline which is failing

steps:

  • template: maven_authentication.yml
  • task: Gradle@2 env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) MAVEN_FEED_USER_NAME: 'AzureDevOps' inputs: workingDirectory: '' gradleWrapperFile: 'gradlew' gradleOptions: '-Xmx6144m' publishJUnitResults: false testResultsFiles: '**/TEST-*.xml' tasks: 'app:bundleDebug' mavenAuthenticateFeed: true
  • This looks like it could be an issue with the compiler, rather than with your code. You could consider creating a ticket at kotl.in/issue – Sam Dec 16 '22 at 07:47
  • Are you using the same versions of everything on your laptop as on the pipeline? – Slaw Dec 16 '22 at 17:25
  • Starting with [kotlin 1.5](https://kotlinlang.org/docs/whatsnew15.html#kotlin-jvm) , Kotlin needs a JDK with version 1.8 (i.e. Java 8) or higher.Check your JDK version and source in your pipeline. – Dou Xu-MSFT Dec 19 '22 at 05:48
  • @Sam I am using same version on laptop and pipeline both. – Mekal Kesharwani Dec 23 '22 at 10:12
  • Can you provide task information including configurations in your pipeline for further analyzing possible causes? You can edit your poster. – Dou Xu-MSFT Dec 27 '22 at 01:48
  • I am using Task Gradle@2. and follwing is the yml file steps:- template: maven_authentication.yml - task: Gradle@2 env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) MAVEN_FEED_USER_NAME: 'AzureDevOps' inputs: workingDirectory: '' gradleWrapperFile: 'gradlew' gradleOptions: '-Xmx6144m' publishJUnitResults: false testResultsFiles: '**/TEST-*.xml' tasks: 'app:bundleDebug' mavenAuthenticateFeed: true – Mekal Kesharwani Jan 11 '23 at 07:39

0 Answers0