How to resolve bug of:uncompiled PNG file passed as argument. Must be compiled first into .flat file.

cover from :https://stackoverflow.com/questions/45954209/issues-with-resources-generated-by-react-in-android-studio-3

I recently upgraded to Android Studio 3

gradle plugin: 3.0.0-beta2
gradle: 4.1

In our project we use: "react-native": "0.46.4" with the

codepush plugin.

Building:

gradlew assembleStagingDebug

works just fine, but as soon as I try to build production:

gradlew assembleProductionRelease

I get an error caused by resources that are created by react in the processProductinoReleaseResources task:

Issues:
 - ERROR: /Users/user/react/android/app/build/intermediates/res/merged/production/release/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png uncompiled PNG file passed as argument. Must be compiled first into .flat file.
 - ERROR:  failed parsing overlays
        at com.android.builder.internal.aapt.v2.AaptV2Jni.buildException(AaptV2Jni.java:154)

In my conquest against this issue I tried it with disabling proguard like:

buildTypes {
        release {
            debuggable true
            minifyEnabled false
            shrinkResources false
        }
        debug {
            debuggable true
            minifyEnabled false
            println proguardFiles
        }
    }

HOW TO SOLVE IT?

In your gradle.properties file add following lines:

classpath 'com.android.tools.build:gradle:3.0.0'
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
android.enableAapt2=false

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

  • 我們是這樣的: 面對陌生又充滿探險的世界呱呱墜地時,我們吸到了這個世界第一口氧氣,嚎啕大哭,而身旁的人卻喜...
    雨瑟清清閱讀 289評論 0 0
  • 與其期望遇到一個誰,不如指望你自己能吸引什么樣的人; 與其指望每次失落的時候會有正能量出現(xiàn)溫暖你,不如指望...
    夢戲筆談閱讀 233評論 0 1
  • 聽了一一老師的POA的課程,學到很多東西,以下是我學到的內(nèi)容,分享給大家。 一一老師那剛開始講的時候,先讓大家做了...
    陳玉冬閱讀 1,157評論 0 2
  • 本期預測: 獨膽:6 二膽:26 三膽:026 五碼組合:02468(含組三) 精選:602,648,684,40...
    德嘉偉業(yè)閱讀 231評論 0 0

友情鏈接更多精彩內(nèi)容