Search code examples
windows-phone-8.1windows-phoneappceleratorappcelerator-titaniumappcelerator-mobile

Titanium windows support for logging, layout and pickers


I've been trying to add a project on titanium to windows phone. Sadly the documentation hasn't been particularly helpful with regards to several problems I've had. Note that I've tried fresh installs of this with fresh projects with a lot of googling and still not had any luck. Oh and I only use the CLI cause I have worse problems with the GUI

I think the first most annoying thing is that the logging module just cuts out after the application loads so I can't log anything, not sure what's up with that.

Second is the layout issues. I recognise that windows phone has different elements and is styled differently, but there are giant margins on textfields that I can't get rid of.

Third I tried to include a picker, however, there simply is not way to set the background once it opens, nor can I adjust the theme (of which defaults to dark), plus the setSelectedRow option doesn't work.

There's probably more, but these are the issues I've spent the most time one.

I think my build log might say something about what's wrong, there's a lot of warnings and errors:

C:\Users\username\work\cpi-app>appc ti build -p windows -T wp-emulator -C 8-1-1
Appcelerator Command-Line Interface, version 5.4.0
Copyright (c) 2014-2016, Appcelerator, Inc.  All Rights Reserved.

8/17/2016, 7:06:50 PM

Operating System
  Name                        = Microsoft Windows 10 Pro
  Version                     = 10.0.14393
  Architecture                = 64bit
  # CPUs                      = 2
  Memory                      = 3178790912

Node.js
  Node.js Version             = 4.4.7
  npm Version                 = 2.15.8

Titanium CLI
  CLI Version                 = 5.0.9

Titanium SDK
  SDK Version                 = 5.4.0.GA
  SDK Path                    = C:\ProgramData\Titanium\mobilesdk\win32\5.4.0.GA
  Target Platform             = windows

Command
  C:\Program Files\nodejs\node.exe C:\Users\username\.appcelerator\install\5.4.0\package\node_modules\titanium\lib\titanium.js build -p windows -T wp-emulator -C 8-1-1 --config-file C:\Users\username\AppData\Local\Temp\build-1471417604044.json --log-level info --no-banner --project-dir C:\Users\username\work\cpi-app

[INFO]  Building for Windows Phone emulator: 8-1-1
[INFO]  Deploy type: development
[INFO]  Debugging disabled
[INFO]  Profiler disabled
[INFO]  Launching emulator: 8-1-1
[INFO]  Missing 7 app icons, generating missing icons
[INFO]    Square24x24Logo.png - Used for badge - size: 24x24
[INFO]    Square44x44Logo.png - Used for logo - size: 44x44
[INFO]    Square71x71Logo.png - Used for logo - size: 71x71
[INFO]    Square150x150Logo.png - Used for logo - size: 150x150
[INFO]    Logo.png - Used for logo - size: 150x150
[INFO]    StoreLogo.png - Used for logo - size: 50x50
[INFO]    SmallLogo.png - Used for logo - size: 30x30
[INFO]  Processing JavaScript files
[INFO]  Generating i18n files
[INFO]  Generating Native Type Wrappers
[INFO]  Setting up native modules for CMakeLists.txt...
[INFO]  Writing appxmanifest C:\Users\username\.titanium\vsbuild\cpi-app\Package.store.appxmanifest.in
[INFO]  Writing appxmanifest C:\Users\username\.titanium\vsbuild\cpi-app\Package.phone.appxmanifest.in
[INFO]  Writing appxmanifest C:\Users\username\.titanium\vsbuild\cpi-app\Package.win10.appxmanifest.in
[INFO]  Writing CMakeLists.txt: C:\Users\username\.titanium\vsbuild\cpi-app\CMakeLists.txt
[INFO]  CmakeLists.txt contents unchanged, retaining existing file.
[INFO]  Running cmake at C:\ProgramData\Titanium\mobilesdk\win32\5.4.0.GA\windows\cli\vendor\cmake\bin\cmake.exe in directory C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86
[INFO]  -- Could NOT find GTest (missing:  GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
[INFO]  -- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE)
[INFO]  -- Configuring done
[INFO]  -- Generating done
[INFO]  -- Build files have been written to: C:/Users/username/.titanium/vsbuild/cpi-app/phone.x86
[INFO]  Running MSBuild on solution: C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.sln
[INFO]  Windows Phone emulator is ready
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/done'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/cancel'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/checkin'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/leaders'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/events'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/groups'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/stream'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/cancel'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/checkin'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/done'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/events'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/groups'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/leaders'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/stream'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/done'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/cancel'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/checkin'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/leaders'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/events'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/groups'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/stream'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]


"C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.sln" (default target) (1) ->
"C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj.metaproj" (default target) (2) ->
"C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj" (default target) (6) ->
(_SplitResourcesPri target) ->
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/cancel'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/checkin'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/done'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/events'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
[WARN]  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/groups'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/leaders'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]
  MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/stream'. The application may throw an exception for certain user configurations when retrieving the resources. [C:\Users\username\.titanium\vsbuild\cpi-app\phone.x86\CPInteriors.vcxproj]

    14 Warning(s)
    0 Error(s)

Time Elapsed 00:00:21.87
[INFO]  Writing build manifest: C:\Users\username\.titanium\vsbuild\cpi-app\build-manifest.json
[INFO]  Copying results back to project build directory
[INFO]  Finished building the application in 30s 892ms
[INFO]  Installing and launching the application. Please wait as this may take some time...
[INFO]  Installing dependency: Microsoft.VCLibs.x86.12.00.Phone.appx
[INFO]  Project built successfully in 30s 932ms

[INFO]  Installing the application...
[INFO]  Connected to app
-- Start application log -----------------------------------------------------
[INFO]  Database is up to date and running with migration version: 2
[INFO]  Logger printing some log text
[INFO]  Finished installing the application
[INFO]  Waiting for app to connect to log relay
[INFO]  Finished launching the application
-- End application log -------------------------------------------------------

Solution

  • Although it became stable a year ago, Titanium SDK support for Windows Phone is still very poor. It is almost impossible to create fully functional app in Appcelerator for that OS. Some examples:

    • Ti.UI.SIZE is not supported
    • log output is still not available
    • as you discovered, there are several other GUI problems