Cocould not find property & #39; outputFile & #39; on com. android. build. gradle. internal. api. ApplicationVariantImpl, androidgradle

Source: Internet
Author: User

Cocould not find property 'outputfile' on com. android. build. gradle. internal. api. ApplicationVariantImpl, androidgradle

After Android studio is upgraded from 1.0 RC 4 to 1.0 (in fact, an 8 m patch is installed), the corresponding gradle version will directly use "com. android. tools. build: gradle: 1.0.0 ". If you use outputFile in the gradle file, the above problem will occur. Well, this is actually a problem for the gradle team. Sometimes we want gradle to have a very good compatibility with the old version like android.

Let's talk about how to solve this problem. The reason for this problem is that the outputFile function has been replaced.

Old:

applicationVariants.all { variant ->            ......            variant.outputFile = new File(variant.outputFile.parent, name);    ......            }}

 

 

New:

applicationVariants.all { variant ->            ......            variant.outputs.each { output ->                output.outputFile = new File(output.outputFile.parent, name);    ......            }}

 

 

If you change it as described above, it will be OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.