[ALOY-1260] Windowsphone not in platforms list in manifest.json
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-04-13T17:39:53.000+0000 |
Affected Version/s | Alloy 1.6.0 |
Fix Version/s | Alloy 1.6.0 |
Components | n/a |
Labels | qe-4.0.0 |
Reporter | Eric Wieber |
Assignee | Feon Sua Xin Miao |
Created | 2015-04-03T18:26:39.000+0000 |
Updated | 2015-04-20T21:15:56.000+0000 |
Description
The manifest.json in the SDK is missing windowsphone (or windows) from the platforms array. This is causing windowsphone assets to be in a default alloy project on Mac, as well as windowsphone assets to be included in a packaged APK, on Mac.
File is: Titanium/mobilesdk/osx/4.0.0.Beta2/manifest.json
*Steps to reproduce issue*:
1. Open Studio
2. Create a new project (default Alloy template)
3. Package the project for Android store
4. Navigate to the APK and rename it to a .zip file
5. Extract the zip
*Actual Results*:
2. Notice that there is a windowsphone folder/assets in the app/assets
folder
5. Notice that there are windowsphone assets in /assets/Resources
of the extracted APK
*Expected Results*:
There should not be windowsphone resources in the project or APK
Attachments
Please note that the fix is not to add it to the manifest, but rather, remove the assets.
[~ingo] Sorry, but you are wrong. The suggested fix is the appropriate fix. https://github.com/appcelerator/titanium_mobile/blob/master/android/cli/commands/_build.js#L2472-L2480
ti.availablePlatformsNames
is the array of platforms from the manifest.json file. As we copy files from the Resources directory, we ignore all directories that have a name of another platform. iOS does the same thing: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L3470-L3476 So does Mobile Web: https://github.com/appcelerator/titanium_mobile/blob/master/mobileweb/cli/commands/_build.js#L403 Heck, even the Windows Phone platform! https://github.com/appcelerator/titanium_mobile_windows/blob/master/cli/commands/_build.js#L1243-L1250 So, the fix IS to add "windowsphone" to the array of platforms in the SDK's manifest.json. P.S. This would not be an issue had we taken my suggestion to have explicit "Resources-android", "Resources-ios", "Resources-mobileweb", etc directories in the project root. Putting platform-specific resources in the Resources directory and trying to identify which directories are platforms names is poor design.[~cbarber] We are not shipping any Windows Phone functionality in 4.0, so why should we add it to the manifest.json?
[~ingo] Then don't create 4.0 SDK builds containing the Windows Phone platform.
So I'm not. http://jenkins.appcelerator.org/job/titanium_mobile_4.0.x/configure And I don't see it in the .zip file http://builds.appcelerator.com/mobile/4.0.0/mobilesdk-4.0.0.Beta2-osx.zip Where is it sneaking in?
[~ingo] Perhaps Eric created the test app with an SDK containing the Windows Phone platform, then switched to 4.0.0.Beta2?
I only have 4.0.0.Beta2 installed, however you can see the assets here:
Ah, Windows Hybrid.
No, Windows Hybrid resources would be in the
mobileweb
directory.Isn't that what he's saying? /mobileweb/templates/packages/winstore
This is not a Windows Hybrid related issue. This is an Alloy issue introduced by ALOY-1085. This wouldn't be a problem if "windowsphone" was in the list of platforms in the manifest. Because Windows Phone is not shipping with 4.0.0, then Alloy should be fixed to determine what platforms the SDK supports before copying assets from the app/assets directory to the Resources directory. File a ticket.
Feon, can you please take a look?
1_6_X: https://github.com/appcelerator/alloy/pull/680 master: https://github.com/appcelerator/alloy/pull/682
I am still seeing Windows assets in newly created Alloy projects:
app/assets/windows
. Is this intended?[~ewieber] Yeah, that should be fine as long as the contents of that
windows
folder is not copied during compile.In that case, verified as fixed using: MacOS 10.10.3 Studio 4.0.0.201504170803 Ti SDK 4.0.0.Beta3 Appc NPM 0.3.44 Appc CLI 0.2.250 Ti CLI 4.0.0-beta7 Alloy 1.6.0-beta4 Node v0.10.38 Windowsphone assets are not copied into the apk on packaging.