1

I am new to android development.

I am creating an android library (.aar) and the library variant in gradle is as follows :

variant.outputs.all { 
   output -> def outputFile = output.outputFile 
  if (outputFile != null && outputFile.name.endsWith('.aar')) 
 { 
     def fileName = "${archivesBaseName}.aar"
     output.outputFile = new File(outputFile.parent, fileName)
    } 
}

And the error is :

Cannot set the value of read-only property 'outputFile' for object of type com.android.build.gradle.internal.api.LibraryVariantOutputImpl.

Previously, it was working fine. But now I have updated the android studio to 3.0 & the gradle plugin causing this error.

Mak083
  • 1,160
  • 1
  • 13
  • 33

1 Answers1

1

Read this : you will be able to fix your issue. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#variant_api

Sylvain
  • 113
  • 7