Today I received the Android Studio 3.0 update push. I encountered several problems during the upgrade process. I will record the problems and solutions here to facilitate the children's shoes to be upgraded. If you still encounter different problems with children's shoes, you can also comment and make a record
Package, custom apk name code error (Cannot set the value of read-only property 'outputFile' )
Report an error
Error:(56, 0) Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[]}} of type .
<a href="openFile:D:\eclipseCode\ipay-android\xinlebao\" rel="external nofollow" >Open File</a>
Solution: Please write this way to modify the file name code
{ variant -> { outputFileName = "xinlebao_${}_${releaseTime()}.apk" } }
2. AAPT2 compile error AAPT2 error
Report an error
Error:: .aapt2.Aapt2Exception: AAPT2 error: check logs for details
Solution: Close APPT2 compilation in
android.enableAapt2=false
Note: If it is eclipse to the project on as, there may be no files, please create it manually in the project root directory.
Error:Cannot choose between the following configurations of project :mylibrary:)
Report an error:
Error:Cannot choose between the following configurations of project :mylibrary:
- debugApiElements
- debugRuntimeElements
- releaseApiElements
- releaseRuntimeElements
All of them match the consumer attributes:
solve
//1. Delete in projectclasspath ':android-apt:1.8' //2. Delete in moduleapply plugin: 'android-apt' //3. Confirm dependency in module fileapt ':butterknife-compiler:8.1.0' //Change toannotationProcessor ':butterknife-compiler:8.1.0'
Other dependencies that use apt should also be changed in this way
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.