Capability not found using demo app

I don't get it, <device> X has no capabilities in it!!!!
chris_loftus
Posts: 6
Joined: Fri Jan 08, 2016 2:51 pm

Capability not found using demo app

Postby chris_loftus » Fri Jan 08, 2016 3:06 pm

Hello,

From the below you can see that most of the capabilities are not available.
I'm using the demo app. The change I've made is to use the wurfl.xml file instead of wurfl.zip. I changed the wurfl_config_standard.php file to have:

Code: Select all

$wurflConfig->wurflFile($resourcesDir.'/wurfl.xml');
The capabilityFilter remains commented out.

I added a debug statement to show the resource directory.

Code: Select all

Resource dir /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/examples/demo/inc/../../resources
WURFL XML INFO

VERSION: for API 1.6.4, db.scientiamobile.com - 2015-12-03 14:33:12

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
ID: generic_web_browser
Brand Name: 
Fatal error: Uncaught InvalidArgumentException: no capability named [brand_name] is present in wurfl. in /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDevice.php:130 Stack trace: #0 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/examples/demo/index.php(29): WURFL_CustomDevice->getCapability('brand_name') #1 {main} thrown in /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDevice.php on line 130
Any help would be appreciated. Perhaps I should not use the xml file but stay with the wurfl.zip file? I'm running Yosemite

Thanks

aaronp
Posts: 223
Joined: Wed Dec 09, 2015 12:39 pm

Re: Capability not found using demo app

Postby aaronp » Fri Jan 08, 2016 4:12 pm

Hi Chris,

Apologies for the inconvenience, we will update the mandatory capability list to reflect all the necessary capabilities. For now, could you try clearing your persistence directory and commenting out the capability filter? In order to use the filter, you will need to add all mandatory capabilities which include:

Code: Select all

device_os
device_os_version
is_tablet
is_wireless_device
pointing_method
preferred_markup
resolution_height
resolution_width
ux_full_desktop
xhtml_support_level
is_smarttv
can_assign_phone_number
brand_name
model_name
marketing_name
mobile_browser_version
Let me know if you have any other questions.

Thanks,
Aaron

chris_loftus
Posts: 6
Joined: Fri Jan 08, 2016 2:51 pm

Re: Capability not found using demo app

Postby chris_loftus » Fri Jan 08, 2016 5:24 pm

Hi Aaron,

Thanks or the quick reply. When I remove the contents of the persistence directory I now get an exception:

Code: Select all

Resource dir /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/examples/demo/inc/../../resourceswurflDir dir /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/examples/demo/inc/../../../WURFL
Fatal error: Uncaught Exception: There is no device with ID [generic] in the loaded WURFL Data in /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDeviceRepository.php:104 Stack trace: #0 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDeviceRepository.php(70): WURFL_CustomDeviceRepository->getDevice('generic') #1 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDeviceRepository.php(63): WURFL_CustomDeviceRepository->init() #2 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/DeviceRepositoryBuilder.php(89): WURFL_CustomDeviceRepository->__construct(Object(WURFL_Storage_File), Array) #3 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/WURFLManagerFactory.php(166): WURFL_DeviceRepositoryBuilder->build('/Users/chrislof...', NULL, Array) #4 /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/WURFLManagerFactory.php(150): WURFL_WURFLManagerFactory->deviceRepository(Object(WURFL_Storage_File), Object(WURFL_UserAgentHa in /Users/chrisloftus/Sites/code/with-wurfl/wurfl-php-1.6.4.2/WURFL/CustomDeviceRepository.php on line 104
I'm running MAMP server with PHP 7.0.0

Thanks
Chris

chris_loftus
Posts: 6
Joined: Fri Jan 08, 2016 2:51 pm

Re: Capability not found using demo app

Postby chris_loftus » Sat Jan 09, 2016 5:19 am

I also tried the demo app on a different server and received the same error message after deleting the persistence and cache folders.

Chris

Elliotfehr

Re: Capability not found using demo app

Postby Elliotfehr » Sat Jan 09, 2016 5:56 pm

Chris,

From what you have mentioned, the wurfl.xml does not seem to be completely loaded into your persistence directory. I would recommend to once again empty your persistence and cache directories and allow the API to load the wurfl.xml file after (may take some time to complete).

If your previous loading process did not complete, you may also need to delete a lock file that is placed during the wurfl.xml loading process that can usually found in your system's tmp directory (retrieved using `sys_get_temp_dir()`), or the `upload_tmp_dir` if defined in your php.ini.

Thank you,

Elliot

chris_loftus
Posts: 6
Joined: Fri Jan 08, 2016 2:51 pm

Re: Capability not found using demo app

Postby chris_loftus » Sun Jan 10, 2016 5:41 am

Thanks Elliot. Yes it seems to be working fine now.
Chris


Who is online

Users browsing this forum: No registered users and 1 guest