언어 설정

Menu
Sites
Language
Cannot deploy to emulator due to certificate error

I've been unable to deploy to an emulator for reasons unknown.  The error message I get tells me that I don't have a certificate for the device. But I have followed the steps for getting a distributer certificate.  While these steps have successfully resolted in certificates that work for my hardware devices the certificates have not worked for any of the emulators for me. 

 

Error Message

The Application installation on the device has failed due to a signature error! (error code: 22)

You need an appropriate certificate profile, which can be created or activated in the Certificate Manager. Do you want to open the Certificate Manager?

 

Steps

I've created a new Tizen 2.3.1 Wearable application. I've started the Tizen 2.3.1 circular emulator. On first run the above error message appears. This is expected. If I right-click on the emulator's connection and select "permit to install application" I gt an error message about a certificate. This is also expected since I haven't created a certificate yet.

Opening the properties for the emulator from the list of connected devices I'm able to get the emulator instance's DUID. Opening the certificate manager I see my author certificate expires in 2017. I create a new distributer certificate. The newly created distributer certificate is part of my active security profile. 

When I right-click on the emulator in the list of connected devices I'm able to select "Permit to install Applications." I get a success message. Great. Now when I try to deploy the application I get the error message above.  I've gone through the steps for Tizen 2.3.1 and 2.3 with the same results.  The logs for one of the attempt follow. 

 

Log

Launching the Tizen application...

# If you want to see the detailed information,
# please set the logging level to DEBUG in Preferences and check the log file in 'C:\tizen-studio-data\ide\logs/ide-20161230_012153.log'.

[Initializing the launch environment...]
    RDS: On
    Target information: W-2.3.1-circle
    Application information: Id(EW9SjSBAhm.Control), Package Name(EW9SjSBAhm), Project Name(Control)
[Transferring the package...]
    Transferred the package: wgt stream -> /opt/usr/apps/tmp/Control.wgt
[Installing the package...]
path is /opt/usr/apps/tmp/Control.wgt
start process (install)
....
error : 22

end process (fail)
processing result : SIGNATURE_INVALID [22] failed
spend time for pkgcmd is [10668]ms
cmd_ret:22
    An exception occurred
(Installing the package... > Fail)
An exception occurred
Unexpected stop progress...
(18.196 sec)

Responses

13 댓글
Iqbal Hossain

Hi~

If you followed the process correctly and still find this error, i will suggest you to delete all the generated certificate and create new one. 

Delete from tizen-studio-data/keystore/author

And follow these steps properly to create certificate. 

http://developer.samsung.com/z/develop/getting-certificates/create

-Thanks

Joel Ivory Johnson

Same error occurs.

Small differnce, but for the sake of anyone hat experiences the same problem in the future Tizen Studio stored new certificates in a different location for me. It defaulted to c:\users\<user name>\SamsungCertificates.

As asked I've deleted the author certificate. To be on the safe side I deleted both the ones in c:\users\<user name>\Sa,sungCertificates (from when I tried to make a new distributor certificate before) and the one's from c:\tizen-sdk-data. I recreated new author and distributor certificates and ensured the Tizen version in both my config.xml and the emulator that I am using match. 

Upon deploying again I see the same error; deployment fails with a certificate error. 

I double checked the time settings on my computer. The time and time-zone are correct. When I check the time on the emulator it is off by 2 hours. I can't tell if the emulator is using a different time zone or if it's time is just wrong. In either case there doesn't appear to be a way to change it. 

 

Additional information: when the deployment fails this is what is printed in the device logs on the emulator (minus time stamps).

 

ERROR / CAPI_APPFW_APPLICATION ( 2502 : 2502 ) : app_error.c: app_error(59) > [app_get_id] INVALID_CONTEXT(0xfef00001) : failed to get the application ID
ERROR / CAPI_APPFW_APPLICATION ( 2502 : 2502 ) : app_error.c: app_error(59) > [ui_app_main] INVALID_CONTEXT(0xfef00001) : failed to get the package
ERROR / W_HOME ( 2320 : 2320 ) : pkgmgr.c: _start(436) > (_exist_request_in_list(package)) -> _start() return
ERROR / APPS ( 2320 : 2320 ) : pkgmgr.c: _pkgmgr_cb(711) >  pkgmgr_cbs[0].func has errors.
ERROR / WRT_INSTALLER ( 2502 : 2502 ) : installer_logic.cpp: NextStep(175) > Exception occured: Error occured in ParserSchema.(22). Reverting job...
ERROR / WRT_INSTALLER ( 2502 : 2502 ) : job_widget_install.cpp: SendFinishedFailure(317) > Error number: 22
ERROR / WRT_INSTALLER ( 2502 : 2502 ) : job_widget_install.cpp: SendFinishedFailure(318) > Message: Error occured in ParserSchema.
ERROR / W_HOME ( 2320 : 2320 ) : pkgmgr.c: _end(649) > (strcasecmp(val, "ok")) -> _end() return
ERROR / APPS ( 2320 : 2320 ) : pkgmgr.c: _pkgmgr_cb(711) >  pkgmgr_cbs[6].func has errors.
ERROR / CAPI_APPFW_PACKAGE_MANAGER ( 2213 : 2213 ) : package_manager.c: package_manager_error(117) > [package_info_create] NO_SUCH_PACKAGE(0xfeeb0071)
ERROR / W_HOME ( 2320 : 2320 ) : pkgmgr.c: _end(645) > (!_exist_request_in_list(package)) -> _end() return
ERROR / APPS ( 2320 : 2320 ) : pkgmgr.c: _pkgmgr_cb(711) >  pkgmgr_cbs[6].func has errors.
ERROR / CAPI_APPFW_PACKAGE_MANAGER ( 2213 : 2213 ) : package_manager.c: package_manager_error(117) > [package_info_create] NO_SUCH_PACKAGE(0xfeeb0071)
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: _preference_check_retry_err(459) > key(clock_font_color), check retry err: -21/(2/No such file or directory).
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: _preference_get_key(1028) > _preference_get_key(clock_font_color) step(-17825744) failed(2 / No such file or directory)
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: preference_get_int(1063) > preference_get_int(2338) : key(clock_font_color) error
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: _preference_check_retry_err(459) > key(showdate), check retry err: -21/(2/No such file or directory).
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: _preference_get_key(1028) > _preference_get_key(showdate) step(-17825744) failed(2 / No such file or directory)
ERROR / CAPI_APPFW_APPLICATION_PREFERENCE ( 2338 : 2338 ) : preference.c: preference_get_int(1063) > preference_get_int(2338) : key(showdate) error

 

Peter Wegner

Can you give some Background infos...

 

Tizen Studio?

If yes... 1.0.0 or 1.0.1 or 1.0.2 or ?

 

Your Computer is what? Windows machine? If yes... what...

Win 7 or 8 or 10 or?

 

32 or 64 bit?

 

Btw...

I never tested Wearables...

 

But in Tizen Studio I have realized their is 1 RPM in few folders...

Here are the f. (f for fery usefull) Certs inside which are mandatory for Emulator Image...

No idea what is preinstalled in Image...

 

Maybe something goes wrong... and this *.RPM is not preinstalled...

Certs and Fingerprint blabla inside...

 

Only idea...

 

Best Regards

Peter Wegner

I mean this funny file...

tizen-security-policy-2.3.2-1.i586.rpm

gear_test_public.pem and the other cra. ehm "mandatory" Security related files inside...

 

You can unpack this RPM and check if files allready in Emulator Image... or you have to install this RPM manually...

 

Again. Only idea...

 

Good Luck.

 

best Regards

 

 

Joel Ivory Johnson

Requested background information:

  • Tizen Studio 1.0.2. I never had any prior version of Tizen Studio, though I had used the Tizen SDK before. 
  • Windows 10 Pro 64-bit

I created a new emulator image and tried installing some of the RPMs that I found in the Tizen-Studio folder. For almost all of them I got back a message saying they were already installed. The exception was "tizen-security-policy-2.3.2-1.i586.rpm". Note that even though this says 2.3.2 it was found in the folder for the 2.3.1 files. When I tried installing it I got the following message. 

Preparing...                ########################################### [100%]
        file /usr/etc/ace/TizenPolicy.xml from install of tizen-security-policy-2.3.2-1.i586 conflicts with file from package tizen-security-policy-1.2.2.1-1.4.i586
        file /usr/share/wrt-engine/fingerprint_list.xml from install of tizen-security-policy-2.3.2-1.i586 conflicts with file from package tizen-security-policy-1.2.2.1-1.4.i586

I also noticed that when the emulator starts there is a message box that appears, easy to miss since it is non-modal and may appear behind another window.

Extra package installation is failed.
cert must be installed manually.

Can't tell if this is related to the above security policy error or not. But when I check the emulator's files I do see that the device_profile.xml file has been copied to it. When I pull the file from the emulator and examin it's contents the device ID in the file matches the device ID of the emulator. 

Peter Wegner

I have only SDKs... and oldest Tizen Studio 1.0.0 on my Win 7 PC... 64 bit.

 

I was tooo lazy to download 1.0.1 nor 1.0.2 to prevent to cry... if new Bugs... or something magic changed...

"""But when I check the emulator's files I do see that the device_profile.xml file has been copied to it."""

 

This looks interesting... Never realized... Will check my Tizen Studio 1.0.0 for this... I thought ever only real device have this...

As Reference devices like RD-PQ or TM1 never needed this device_profile.xml in home/developer folder...

As all Certs etc allready preinstalled...

 

I have nearly 0 Wearables experiences...

But maybe you have time to check the differences from RPM allready installed... and RPM in Tizen studio 1.0.2 which fails...

And maybe you can compare with device...

In theory simple compare this file:

/usr/share/wrt-engine/fingerprint_list.xml

Ehm if I remember correct. Gear S2 and S3 have 1:1 same Certs and Fingerprint...

 

For my Z1 (SM-Z130H) I have "modified" this file and added missing Certs... so I have nuked device_profile.xml...

This worked also with Z3 and Z2...

 

Wearables and for instance SM-Z300F have few more Certs and fingerprint_list.xml is different...

In case of SM-Z300F Certs are removed... to prevent installation of commercial signed TPK and WGT...

Btw. HARHARHAR... commercial signed TPKs are totally easy to install on Z series... No need of SDB.

Simple Copy and Paste and clickclick in My Files app.

 

No idea why Samsung creates this pain for Developers...

This is ever an Riddle or Puzzle... and they changed something from time to time to create new confusion...

 

Best Regards

Peter Wegner

Oh sorry, forgotten.

 

As Windows User you can extract RPM with 7zip for instance...

Then you can compare...

 

Best Regards

Peter Wegner

""But when I check the emulator's files I do see that the device_profile.xml file has been copied to it. When I pull the file from the emulator and examin it's contents the device ID in the file matches the device ID of the emulator. ""

 

IMHO this seems wrong... if you have device_profile.xml in /home/developer in Tizen Studio Emulator...

Please remove this file and check your Widget again... *.wgt

No idea if you have to start again.... Restart/Reboot...

 

I have only checked my Tizen Studio 1.0.0... but I am sure... this is also not necessary in Tizen Studio 1.0.2...

 

device_profile.xml is ONLY for real target/device and only for the commercial variants... not for Reference devices...

Like TM1, TM2... RD-PQ...

 

No idea how Circle Wearable looks like... I mean the Wearable Reference device...

They are all rooted and with all mandatory Certs for Developing...

 

Best Regards

Joel Ivory Johnson

Once I get everything working I will probably be hesitant to install any updates myself unless I have too; too afraid of it messing something else up. 

 

For the emulated devices I found that sometimes the IDE can run a program on the emulator once and only once without errors about a certificate. This only seems to work if I choose "Run as..." instead of "Debug as...". But in either case after that one attempt or attempt run it will give the error about the certificate. 

 

But you are right, when I check the information about deploying to an emulator there are no steps mentioned about deploying the certificate. I created a new VM instance and never installed any certificate to it, but I get the same error.  I also tried modifying the fingerprints_list.xml file by adding some signatures that were in the tizen policy.xml that I didn't see in the fingerprints_list.xml file. I can't tell what I did wrong but I ended up getting error 42 instead of error 22 after I tried that. So back to a pristine new emulator instance. 

 

On a new instance of the emulator on which a certificate had never been installed thereis still the error 22 about an invalid certificate. 

 

I've got the SDK installing on another machine now. Am going to see if all works well and then install Tizen Studio and see if the problem resurfaces. 

André Reus

I have faced the same issue! 
What i did to solve this:-

* Delete all the previous certificate 

* Clean project 
* Create new certificate

* Clean and build project

* Run 

Joel Ivory Johnson

On another machine I completely removed anything Tizen related; my workspaces, the certificates, the tizen SDK, and tizen studio were all deleted. I then reinstalled the Tizen SDK w/IDE (2.4.0 rev 8) and let the package manager do any updates that were available. After making an emulator instance I tried deploying a file and it failed saying I had no certificate profile (expected). I made an author cert and a distribution cert from the emulator's DUID. I did *not* deploy the distribution cert. The application deployed to the emulator without any problem. 

 

I then downloaded and installed Tizen Studio. I imported my project into tizen studio, setup a certificate profile, and tried to deploy the application. The Tizen Studio failed to deploy to the emulator with error 22 about the invalid certificate.  I uninstalled Tizen Studio but left the SDK there. Opening the project back within the IDE that comes with the SDK I tried to deploy again and encountered failure.  Once Tizen Studio has been on a machine it seems that I can't deploy to an emulator from either Tizen Studio or the SDK IDE until I remove them both and start new. 

 

@André Reus - I had previously tried deleting all of my certs, cleaning the project, and rebuilding with a new cert (I had come across some messages where this worked for some people back in September). That didn't work for me. Between the failure on my preferred development computer and the failure on my secondary machine after completely removing all of the Tizen tools and reinstalling them I'm inclined to think that Tizen Studio may have some bugs that make it unusable for me. I've found a few other threads where some had reported similar problems where they were resolved through various solutions (starting a new workspace, creating a new emulator, uninstalling and reinstalling the Tizen-tools, so on).  It looks that I might save myself a good bit of time and frustration if leave Tizen Studio alone for now and stick with the IDE. Will try it out again from a different machine after the next release. 

Peter Wegner

Thank you very much for detailed feedback.

 

Big sorry you not found solution yet.

But it seems you understand why I am scared to install latest Tizen Studio or SDK Versions... as they can do """"funny"""" things...

And we need hours, days, weeks or months to understand why... and find solution for "new" problemS...

 

Last idea(s) and maybe 1 hint...

1.

You have tried your Widget also on RTL device?

http://developer.samsung.com/remotetestlab/rtlDeviceList.action?os=102

 

2.

Did you tried just for fun to compile native... maybe simple Sample?

To have TPK file...

 

In my opinion Widgets ehm Webapps *.wgt are mucher lower protected... and different handled as TPK...

Maybe Error not happens with TPK files?

 

3.

In "theory" it is possible to sign... manually... for "tests"... with Hashsigner Scripts...

It is possible to replace Author or Distributor XML... or both... to check what is wrong in this Security chain...

 

Only as info.

 

But if you have workaround...

 

Best Regards

Joel Ivory Johnson

I'm seeing a couple of other problems I had go away with the roll back to Tizen Studio. The console in the IDE for Tizen Studio wasn't printing output from my programs. In the IDE that comes with the SDK the information prints. Also I had been having a problem where window.localStorage would clear out after every program run (making it act like session storage). That problem isn't happening any more. 

 

I didn't try it on a remote test labs device, but I had been running my widget on a real device. The only reason I preferred to use the emulator is that when the real device is connected to the IDE (over WiFi) the batter drains quickly. Even when left on the charger it drains faster than it can charge and occasionally goes into low power mode from overheating (Strange, I know). 

 

I never tried making a native application. I didn't realize that a native wearable application was an option. development on the watch had been  HTML only for a while. 

 

In the future I might try playing around with it more, but I've got to make up for lost development time now. 

 

One correction to make, after removing Tizen Studio while I initially could not deploy to the Tizen SDK emulators after rebooting I was able to use them again.