Software Archive
Read-only legacy content
17060 Discussions

How to separate android & ios resources after build

Robby_S_1
Beginner
1,732 Views

Hi Guys, I am using XDK to develop and build my cordova app. Everything works fine until I find the size of the apk/ipa file is larger than I expected.

After I unpacked the apk/ipa, I found that all the resources are in the www folder. The resources, I mean the icons, splashscreen images for both android and ios, cer file, provisioning files, etc.  I tried to relocate these files under projects tab in XDK, but the system tell me i should put the files in the source directory (www in my case).

So I am totally lost. How can I separate these? I don't want android build to include ios icons and splashscreens, and BTW why my ios production provisioning file is also in the www folder in ipa and apk? 

I have attached several screenshots for your reference. Please help me as I am struggled for almost a week on this.

Thanks in advance.

 

 

0 Kudos
1 Solution
Luca_F_
Novice
1,732 Views

By reading the Android build log of one app of mine, I found the following workaround:
place your icons and splashscreens into a www subfolder whose name starts with a "dot".

In my case, the folder name is ".sys" (read "dot sys") and the folder structure is

myXDKProject\www\.sys\res\icons\android\<icons.png>
                                              |         \ios\<icons.png>
                                              |         \windows\<icons.png>
                                              |
                                              \screen\android\<splashscreens.png>
                                                          \ios\<splashscreens.png>
                                                          \windows\<splashscreens.png>
        
On Win system, to create such a folder you have to use the command prompt:
prompt>cd myXDKProject
prompt>cd www
prompt>mkdir .sys

This trick doesn't work for iOS provisioning file, but you could place it inside a dummy local plugin
folder, that should be automatically stripped away after plugins and provisioning file have been copied by the build system.
Important note about mobileprovisioning: this trick worked till XDK 1621; with latest XDK versions (XDK 18xy), I'm no more able to remove
plugins source code from built packages, so I always find full plugin source code and the provisioning file too
inside them (for details, see my post here https://software.intel.com/en-us/forums/topic/544718).

Regards
CtwDev

View solution in original post

0 Kudos
6 Replies
Hamilton_Tenório_da_
Valued Contributor I
1,731 Views

It is a good question. I tought about it some days ago...

0 Kudos
John_H_Intel2
Employee
1,731 Views

Currently all assets for your app must be in the www/ folder. The provisioning profile is include with your apk because its in the www/ folder. We are planning to implement (no time frame) a way that your assets for icons/splashscreens do not need to be packaged with your app. If you do not want certain files included with a particular build, move them out of the www directory, upload, then move them back in.

0 Kudos
Robby_S_1
Beginner
1,732 Views

JOHN H. (Intel) wrote:

Currently all assets for your app must be in the www/ folder. The provisioning profile is include with your apk because its in the www/ folder. We are planning to implement (no time frame) a way that your assets for icons/splashscreens do not need to be packaged with your app. If you do not want certain files included with a particular build, move them out of the www directory, upload, then move them back in.

Thanks John for the answer, I really hope there is a better way to handle that. Now I have to separate this into two projects and update both before build, then it defer the purpose of the IDE, right? Looking forward to see the update.

0 Kudos
Luca_F_
Novice
1,733 Views

By reading the Android build log of one app of mine, I found the following workaround:
place your icons and splashscreens into a www subfolder whose name starts with a "dot".

In my case, the folder name is ".sys" (read "dot sys") and the folder structure is

myXDKProject\www\.sys\res\icons\android\<icons.png>
                                              |         \ios\<icons.png>
                                              |         \windows\<icons.png>
                                              |
                                              \screen\android\<splashscreens.png>
                                                          \ios\<splashscreens.png>
                                                          \windows\<splashscreens.png>
        
On Win system, to create such a folder you have to use the command prompt:
prompt>cd myXDKProject
prompt>cd www
prompt>mkdir .sys

This trick doesn't work for iOS provisioning file, but you could place it inside a dummy local plugin
folder, that should be automatically stripped away after plugins and provisioning file have been copied by the build system.
Important note about mobileprovisioning: this trick worked till XDK 1621; with latest XDK versions (XDK 18xy), I'm no more able to remove
plugins source code from built packages, so I always find full plugin source code and the provisioning file too
inside them (for details, see my post here https://software.intel.com/en-us/forums/topic/544718).

Regards
CtwDev

0 Kudos
Barry_Johnson
New Contributor I
1,732 Views

This is exactly the sort of feature it would be great to see built in to the XDK along with other build assistance & management features.

0 Kudos
Robby_S_1
Beginner
1,732 Views

Luca F. wrote:

By reading the Android build log of one app of mine, I found the following workaround:
place your icons and splashscreens into a www subfolder whose name starts with a "dot".

In my case, the folder name is ".sys" (read "dot sys") and the folder structure is

myXDKProject\www\.sys\res\icons\android\<icons.png>
                                              |         \ios\<icons.png>
                                              |         \windows\<icons.png>
                                              |
                                              \screen\android\<splashscreens.png>
                                                          \ios\<splashscreens.png>
                                                          \windows\<splashscreens.png>
        
On Win system, to create such a folder you have to use the command prompt:
prompt>cd myXDKProject
prompt>cd www
prompt>mkdir .sys

This trick doesn't work for iOS provisioning file, but you could place it inside a dummy local plugin
folder, that should be automatically stripped away after plugins and provisioning file have been copied by the build system.
Important note about mobileprovisioning: this trick worked till XDK 1621; with latest XDK versions (XDK 18xy), I'm no more able to remove
plugins source code from built packages, so I always find full plugin source code and the provisioning file too
inside them (for details, see my post here https://software.intel.com/en-us/forums/topic/544718).

Regards
CtwDev

 

thanks Luca, that can save me for a while :)

Meantime, let's wait for the official solution.

0 Kudos
Reply