Android Studio Upgrade 3.0 version, problem handling

Source: Internet
Author: User

Android Studio Upgrade 3.0 version, problem handling issue 1: Compile version and build revision

Compilesdkversion:26,
Buildtoolsversion: "26.0.2",
Gradle version:
Distributionurl=https://services.gradle.org/distributions/gradle-4.1-all.zip
Classpath ' com.android.tools.build:gradle:3.0.0 '

Issue 2:apk name Configuration adjustment, build has a outputfilename, direct configuration
Error:(120, 0) Cannot set the value of read-only property ‘outputFile‘ for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[]}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.<a href="openFile:D:\Android\workspace_zhy\qufish_office\app\build.gradle">Open File</a>

            Output APK configuration applicationvariants.All {VariantVariant. outputs. Each {outputdef outputFile= Output. outputFileif (outputFile!=Null&& OutputFile. Name. EndsWith ('. apk ')} { //output APK name def fileName if (variant. BuildType. zipalignenabled) { //Official version FileName = "Xx_${defaultconfig.versionname}_${packagetime ()}_${buildtype.name}.apk"} else { FileName = "Xx_${defaultconfig.versionname}_${packagetime ()}_${buildtype.name}.apk"} Output. OutputFile = new File (OutputFile.  Parent, FileName)                }}} 

After adjustment

            applicationVariants.all {                outputs.all {                    // 输出apk名称                    def newApkName                    if (buildType.zipAlignEnabled) {                        newApkName = "XX_${defaultConfig.versionName}_${packageTime()}_${buildType.name}.apk" } else { newApkName = "XX_${defaultConfig.versionName}_${packageTime()}_${buildType.name}.apk" } outputFileName = newApkName } }
Question 3: If you have multi-channel package configuration, will error dimension
"color"productFlavors {        baidu {//每个渠道多家一个这个配置            dimension "color"...        }}
Question 4:

Compile ' com.android.support:multidex:1.0.1 '

Warehouse location adjustment to Google, you need to add Google (in the configuration warehouse) (when the error is directly clicked or automatically add the warehouse), the other Multidex version number upgrade to 1.0.2

{    repositories {        jcenter()        mavenCentral()        maven { url ‘https://jitpack.io‘ }        google()    }}
Question 5:

Information:gradle tasks [:p ickerview:generatedebugsources,:p ickerview:generatedebugandroidtestsources,: Pickerview:mockableandroidjar,: zhxflib:generatedebugsources,: zhxflib:generatedebugandroidtestsources,: zhxflib: Mockableandroidjar,: wigetlib:generatedebugsources,: wigetlib:generatedebugandroidtestsources,: wigetlib: Mockableandroidjar,: app:generatedebugsources,: App:generatedebugandroidtestsources,: App:mockableAndroidJar]
D:\zhihuixinfanWorkerSpace\ZhiHuiXinFan\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error: (error:unknown element found).
Error: (unknown element found).
Error:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException: Com.android.tools.aapt2.Aapt2Exception:AAPT2 Error:check logs for details
Error:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 Error:check Logs for Details
Error:com.android.tools.aapt2.Aapt2Exception:AAPT2 Error:check logs for details
Error:execution failed for task ': App:processdebugresources '.
Failed to execute AAPT
Information:build FAILED in 8s
Information:6 errors
information:0 warnings
Information:see Complete output in console

Workaround:

In the gradle.properties of the project:
Android.enableaapt2=false

Android Studio Upgrade 3.0 version, problem handling

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.