紀(jì)念一下今天是第一次下決心把RN遇到的坑一個(gè)個(gè)寫(xiě)出來(lái)睁搭,讓大家少走彎路躏吊。
如果大家碰到了這個(gè)ERROR葫掉,error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.
第一個(gè)想到的目尖,應(yīng)該是立馬跑到項(xiàng)目的gradle.propertites文件中添加一句話(huà):
android.enableAapt2=false
不出意外拓哺,就能解決勇垛,下面的你就不用看了。
如果出現(xiàn)其它問(wèn)題士鸥,請(qǐng)檢查你的compileSdkVersion闲孤,建議將compileSdkVersion設(shè)為27(親測(cè)26也是可以),
implementation "com.android.support:appcompat-"后面的版本設(shè)置為v7:27.1.1烤礁,對(duì)應(yīng)compileSdkVersion 27讼积,如果為26則版本應(yīng)設(shè)置為v7:26.1.0。(當(dāng)時(shí)的錯(cuò)誤我已經(jīng)沒(méi)法模擬出來(lái)脚仔,只能通過(guò)當(dāng)時(shí)的解決來(lái)回答)勤众。下面是我使用的版本:
implementation "com.android.support:appcompat-v7:27.1.1"
另附上GitHub上老外們討論的解決方法(一樣):https://github.com/react-navigation/react-navigation/issues/4755