Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1260] Windowsphone not in platforms list in manifest.json

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-04-13T17:39:53.000+0000
Affected Version/sAlloy 1.6.0
Fix Version/sAlloy 1.6.0
Componentsn/a
Labelsqe-4.0.0
ReporterEric Wieber
AssigneeFeon Sua Xin Miao
Created2015-04-03T18:26:39.000+0000
Updated2015-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

FileDateSize
Screen Shot 2015-04-03 at 11.06.43 AM.png2015-04-03T18:26:39.000+0000162111
Screen Shot 2015-04-03 at 11.20.17 AM.png2015-04-03T18:26:39.000+000037172

Comments

  1. Ingo Muschenetz 2015-04-03

    Please note that the fix is not to add it to the manifest, but rather, remove the assets.
  2. Chris Barber 2015-04-03

    [~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
       function (cb) {
       	var src = path.join(this.projectDir, 'Resources');
       	warnDupeDrawableFolders.call(this, src);
       	copyDir.call(this, {
       		src: src,
       		dest: this.buildBinAssetsResourcesDir,
       		ignoreRootDirs: ti.availablePlatformsNames // <----------- ['android', 'iphone', 'mobileweb']
       	}, cb);
       },
       
    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.
  3. Ingo Muschenetz 2015-04-03

    [~cbarber] We are not shipping any Windows Phone functionality in 4.0, so why should we add it to the manifest.json?
  4. Chris Barber 2015-04-03

    [~ingo] Then don't create 4.0 SDK builds containing the Windows Phone platform.
  5. Ingo Muschenetz 2015-04-03

    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?
  6. Chris Barber 2015-04-03

    [~ingo] Perhaps Eric created the test app with an SDK containing the Windows Phone platform, then switched to 4.0.0.Beta2?
  7. Eric Wieber 2015-04-03

    I only have 4.0.0.Beta2 installed, however you can see the assets here:
       /Users/<username>/Library/Application\ Support/Titanium/mobilesdk/osx/4.0.0.Beta2/mobileweb/templates/packages/winstore/ProjectName/images
       
  8. Ingo Muschenetz 2015-04-03

    Ah, Windows Hybrid.
  9. Chris Barber 2015-04-03

    No, Windows Hybrid resources would be in the mobileweb directory.
  10. Ingo Muschenetz 2015-04-03

    Isn't that what he's saying? /mobileweb/templates/packages/winstore
  11. Chris Barber 2015-04-03

    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.
  12. Ingo Muschenetz 2015-04-03

    Feon, can you please take a look?
  13. Feon Sua Xin Miao 2015-04-06

    1_6_X: https://github.com/appcelerator/alloy/pull/680 master: https://github.com/appcelerator/alloy/pull/682
  14. Eric Wieber 2015-04-20

    I am still seeing Windows assets in newly created Alloy projects: app/assets/windows. Is this intended?
  15. Chris Barber 2015-04-20

    [~ewieber] Yeah, that should be fine as long as the contents of that windows folder is not copied during compile.
  16. Eric Wieber 2015-04-20

    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.

JSON Source