Enhance extension, res file issue with Android build (DEF-3926) (SOLVED)



I went to try out enhance and it wouldn’t process due to some files in res such as common_google_signin_btn_text_dark_normal_background.9.png

This is the email I got from the engineer over there at enhance


Tomasz from the Enhance engineering team here.Your app is failing the Enhance process, because of not processed 9-patch png files during apk file export.

Open apk file with as zip file and, for instance, go to “res/rawable-xhdpi-v4” - you have few “*.9.png” files (for instance: “common_google_signin_btn_text_dark_normal_background.9.png”). Not sure how you built you apk file, but looks like these *.9.png were added after the built without processing them. You need to make these steps to have valid apk, which can be uploaded to Enhance:

  1. create on your hard drive “res” dir

  2. open apk file as zip, go to “res” and copy with contents “drawable-hdpi-v4”, “drawable-ldpi-v4”, “drawable-mdpi-v4”, “drawable-xhdpi-v4”, “drawable-xxhdpi-v4” and “drawable-xxxhdpi-v4” dirs to your “res” dir on hard drive,

  3. create dir “out”

  4. you need to have installed android sdk and have access to “aapt” tool from this sdk,

  5. call “aapt c -S res -C out” command - now you should have valid png files in “out” dir

  6. replace dirs listed in step #2 with these from “out” dir - you need to sign again apk if you would like to install this on device. this is not required for re-enhancing

  7. re-enhance new apk file

these steps are not typical scenario for Enhance developers. You should do this, because of invalid png files in your apk.

They were fast at responding to the error and this seems like a fix but just wanted to report it as didn’t know if it was something I am doing wrong or something in the engine has changed.



This might be connected to our upgrade from GCM to FCM for push. @sven?



Are you using any extensions? If so, which ones? Does this happen with an empty project?

1 Like


I built the example project enhance give on 1.2.151 and it also fails so I am guessing an empty project would fail too.

I built my app with defold 1.2.148 and everything went through fine.

It looks like something broke with the newer versions of defold.

Edit: I tried with 1.2.150 and also fails so I am guessing it is something changed after 1.2.148. The engineer there said he will also look into it on Monday.



Sorry to bump this. This is what I got back from enhance devs:

'Sounds like Defold in newer version adds android resource images from Google Play Services without processing them by aapt - just place to final apk. But, this is only my suspicion, because I don’t know what Defold does when it makes apk file. ’

I am currently just using 1.2.148 which is alright.



Hi @ianshk!

As @britzl pointed out, I suspect the update from GCM to FCM is what is triggering this issue. Not sure what the enhance devs means about Defold not processing the GPS resource with aapt, afaik we do this just as before but with newer resources. But it certainly is a good lead, I’m looking into this!



Solved in 1.2.153