Running html5 app template in ubuntu sdk failed? - sdk

My configuration :
Ubuntu 14.04 LTS
64bit
Qtcreator 3.1.1
everything is up-to-date
Hello everyone,
I'm trying to just compile and run an HTML5 App for ubuntu Phone, but after trying and searching for a week now, I still can't make it run !
For the moment I just want to run the simple html5 app template.
This is the situation :
I have installed ubuntu sdk as instructed in https://developer.ubuntu.com/en/start/ubuntu-sdk/installing-the-sdk/
I've created in the run click menu, an i386 build target. (15.04) --- which exited with no errors
I created an i386 emulator in devices --> i386 - devel - default password --- which is finally up and running correctly
The problem is when I compile the default template : theses are the errors I get :
desktop_Exec(app): found unexpected Exec with architecture 'all':./qtc_device_debughelper.py
security_policy_groups_safe_app(debug):(REJECT)reserved policy group 'debug':not for production use
security_policy_version_matches_framework(app.apparmor):invalid framework 'ubuntu-core-15.04'
And when I try to edit it anyway :
This is what I get :
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 29, in <module>
gi.Repository.get_default().require("UbuntuAppLaunch")
gi.RepositoryError: Typelib file for namespace 'UbuntuAppLaunch' (any version) not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 33, in <module>
from gi.repository import UpstartAppLaunch as UAL
File "/usr/lib/python3/dist-packages/gi/importer.py", line 53, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name UpstartAppLaunch, introspection typelib not found
I have been looking for this everywhere but I couldn't find something that works.
I need some of your knowledge to help me understand all this!

I have the same errors. I think that the 'ubuntu-core-15.04'-error is related to the version of Ubuntu you are using. I use Mint 17, which is based on Ubuntu 14.04. Canonical recommends the newer Ubuntu Versions for app-developing, because there is some stuff in it they changed.
unfortunately, I can't help you with the other errors.

Related

IoT Azure Edge ContextualVersionConflict: pyOpenSSL

I am following the Quickstart Azure IoT Edge tutorial and in the Section Configure the IoT Edge runtime.
When I configure the runtime with the IoT Edge device connection string
iotedgectl setup --connection-string "{device connection string}" --nopass
(I changed the connection string) I get the following result
Traceback (most recent call last):
File "/usr/local/bin/iotedgectl", line 11, in <module>
sys.exit(coremain())
File "/Library/Python/2.7/site-packages/edgectl/__init__.py", line 23, in coremain
version = pkg_resources.require(PACKAGE_NAME)[0].version
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 851, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyOpenSSL 0.13.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('pyOpenSSL>=0.14'), set(['docker']))
That does not allow me to continue with the command
iotedgectl start
I looked at the file init.py From line 857-859 There is:
# Register the new requirements needed by req
for new_requirement in new_requirements:
required_by[new_requirement].add(req.project_name)
Lines 848 - 851
if dist not in req:
# Oops, the "best" so far conflicts with a dependency
dependent_req = required_by[req]
raise VersionConflict(dist, req).with_context(dependent_req)
Line 959
needed = self.resolve(parse_requirements(requirements))
What do I need to change there? Or what needs to be configured?
Before installing iotedgectl, you already have a lower version of pyOpenSSL installed, which does not meet iotedgectl's version requirement but precedes the higher version of pyOpenSSL installed along with iotedgectl.
You can check out this answer to learn how to make Python reference the higher version of pyOpenSSL first.
In addition, it seems that you are working on macOS. If so, please refer to Quickstart: Deploy your first IoT Edge module to a Linux or Mac device - preview, instead of Quickstart: Deploy your first IoT Edge module from the Azure portal to a Windows device - preview.
From the message,it shows that the pyOpenSSL is too old, it needs 0.14 or later.
Traceback (most recent call last):
File "/usr/local/bin/iotedgectl", line 11, in <module>
sys.exit(coremain())
File "/Library/Python/2.7/site-packages/edgectl/__init__.py", line 23, in coremain
version = pkg_resources.require(PACKAGE_NAME)[0].version
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py",
line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py",
line 851, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyOpenSSL 0.13.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python),
Requirement.parse('pyOpenSSL>=0.14'), set(['docker']))
You can use the following command to upgrade the pyOpenSSL:
pip install --upgrade pyOpenSSL
If the problem can not be resolved, please feel free to let me know.

Pytest fails on Travis: cannot find main package

I recently made a large swath of changes to a Python 3 project on Github, largely documentation and docstrings.
The tests pass locally, but when I push the branch to Github, Travis CI fails:
$ pytest
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 342, in _getconftestmodules
return self._path2confmods[path]
KeyError: local('/home/travis/build/scossu/lakesuperior')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 373, in _importconftest
return self._conftestpath2mod[conftestpath]
KeyError: local('/home/travis/build/scossu/lakesuperior/conftest.py')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 379, in _importconftest
mod = conftestpath.pyimport()
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/py/_path/local.py", line 668, in pyimport
__import__(modname)
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 212, in load_module
py.builtin.exec_(co, mod.__dict__)
File "/home/travis/build/scossu/lakesuperior/conftest.py", line 6, in <module>
from lakesuperior.config_parser import test_config
ImportError: No module named 'lakesuperior.config_parser'
ERROR: could not load /home/travis/build/scossu/lakesuperior/conftest.py
The command "pytest" exited with 4.
lakesuperior is the main application package.
My .travis.yml:
language: python
python:
- "3.5"
- "3.6"
install:
- pip install -r requirements.txt
- coilmq&
script:
- pytest tests
The only thing that I think may have affected the import issue is that I added some __init__.py files to subpackages in order for Sphinx to discover API docs. I am not sure how that may have messed up CI though.
I verified that the previous commit passes all tests as it used to.
Has anybody encountered this scenario before? Any hints?
Thanks.
I recently had the same issue. I fixed it by removing the __init__.py file from the top level directory. See here.

Deploy IoT Edge module to a Windows device

I am creating IoT Edge using the blog https://learn.microsoft.com/en-us/azure/iot-edge/quickstart.
I have installed Python 2.7, azure-iot-edge-runtime-ctl on a Windows 1709 Virtual machine.
I am running Docker version 17.09 CE and Windows Containers. When I am trying to setup IoT-edge runtime module in Windows 10 VM.
iotedgectl setup --connection-string "{device connection string}" --auto-cert-gen-force-no-passwords
when I am running above command facing the issue, Any suggestions appreciated.
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\iotedgectl.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\edgectl\__init__.py", line 25, in coremain
return cli.execute_user_command()
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 54, in execute_user_command
(is_valid, execute_deployment_cmd) = self._process_cli_args()
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 358, in _process_cli_args
return args.func(args)
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 379, in _parse_edge_command
if EdgeDefault.is_deployment_supported(self._deployment):
File "c:\python27\lib\site-packages\edgectl\default.py", line 99, in is_deployment_supported
client = EdgeDockerClient()
File "c:\python27\lib\site-packages\edgectl\dockerclient.py", line 13, in __init__
self._client = docker.DockerClient.from_env()
File "c:\python27\lib\site-packages\docker\client.py", line 81, in from_env
**kwargs_from_env(**kwargs))
File "c:\python27\lib\site-packages\docker\client.py", line 38, in __init__
self.api = APIClient(*args, **kwargs)
File "c:\python27\lib\site-packages\docker\api\client.py", line 131, in __init__
'Install pypiwin32 package to enable npipe:// support'
docker.errors.DockerException: Install pypiwin32 package to enable npipe:// support
Any suggestions, please.
Problem Solution:
The “npipe:// broken” problem reported here applicable to Windows machines and is a problem whether Linux or Windows containers are used in Docker.
azure-iot-edge-runtime-ctl 1.0.0rc19 was released recently which addresses this issue by ensuring the correct pypiwin32 package is installed.
To get the latest bits execute:
$> pip install -U azure-iot-edge-runtime-ctl
Check installed version:
$> iotedgectl --version
iotedgectl 1.0.0rc19
Summary of issue:
iotedgectl uses library docker-py to communicate with Docker for kick starting and controlling the Edge runtime.
docker-py uses pypiwin32 for communicating with docker over named pipes (npipe). With the release of v222 of pypiwin32 docker-py is broken on Windows hosts.
As a quick workaround until the official fixes can be incorporated, iotedgectl was released which ensures that correctly working dependencies get pulled in.
Is the version of Python you have installed 2.7.14?It seems that pypiwin32 package has not been installed in your PC.Please use pip to install this package like executing the following command in your computer:
pip install pypiwin32

Trigger.io error "/usr/bin/codesign no identity found" can't create package or run the app on the device

I have a problem when trying to run my application on the device or create IPA file.
I followed the steps here and I have this error when trying to run on iOS option:
[ERROR] Failed when running /usr/bin/codesign: FdawaDev: no identity found
I tried to make it throw terminal with this command
forge package ios --ios.profile.provisioning_profile Development.mobileprovision
and I'm getting this error
/Applications/TriggerToolkit.app/Contents/MacOS/forge -v package ios --ios.profile.provisioning_profile Development.mobileprovision
[ INFO] Forge tools running at version 3.3.43
[ DEBUG] Checking for update zip...
[ ERROR] Couldn't import generation code: No module named generate_dynamic
[ DEBUG] Traceback (most recent call last):
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/async.py", line 98, in run
result = self._target(*self._args, **self._kwargs)
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/main.py", line 443, in package
generate_dynamic = forge_build.import_generate_dynamic()
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/build.py", line 67, in import_generate_dynamic
raise ForgeError("Couldn't import generation code: {0}".format(e))
ForgeError: Couldn't import generation code: No module named generate_dynamic
I removed TriggerToolkit and download the latest one, installed it again and I'm still getting the same error.
What am I missing?
The first error is a configuration problem: you're pointing at an iOS developer identity called "FdawaDev" when one doesn't exist in your Keychain.
Unless you have several identities, you can safely leave the "Certificate" Local Config setting empty in the Toolkit.
If you have several identities, you should specify one with something like iPhone Developer: James Brady.
For the second problem, when using the command line tools, you have to manually run a build before doing a run or package action, e.g.:
% forge build ios && forge package ios

Build fail after updating to Mountain Lion

Traceback (most recent call last): File "./Scripts/version.py", line 6, in <module>
from Foundation import NSMutableDictionary File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Foundation/__init__.py", line 8, in <module>
import objc as _objc File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/__init__.py", line 30, in <module>
from objc._bridgesupport import * File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 9, in <module>
import pkg_resources File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 698, in <module>
class Environment(object): File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 701, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR): File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 96, in get_supported_platform
plat = get_build_platform(); m = macosVersionString.match(plat) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 222, in get_build_platform
plat = get_platform() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/util.py", line 98, in get_platform File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 498, in get_config_vars File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 407, in _init_posix distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.8" during configure Command /bin/sh failed with exit code 1
I'm using python script for version control to TestFlight. While building I get some error. I don't know anything about python. What's the problem here?
XCode Version: 4.4
OS: Mountain Lion 10.8
MacBook PRO mid2009
This appears to be the key part of the message:
$MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.8" during
configure
Whatever toolset you are using was configured under Mountain Lion but is now running under Lion, and yet you claim the opposite.
You don't specify what toolset you are using, but it looks like you are going to have to set it up again under your new O/S.
It's a little wonky, but if you edit your .bash_profile and add:
export MACOSX_DEPLOYMENT_TARGET=10.8
You should be okay. I had this same problem when trying to run post-review.
I found the solution, go into your /System/Library/Frameworks/Python.framework/Versions/2.7/lib/distutils/sysconfig.py
Goto line 408 that says "raise DistutilsPlatformError" and add a '#' to comment out that line of code... This will "unleash the python"
You are basically telling python "don't worry its not 10.7, I know" there could be some crashes as a result but I think otherwise. My very complex python applicaiton now compiles on MacOSX 10.8 with no troubles and it seems to do the job, QA still has to test it though.
I am on MacBookPro 2012 MacOSX 10.8

Resources