Languages

Menu
Sites
Language
Tizen SDK: Can't find variable: tizen

I'm trying to create a web-application using Tizen SDK. When I launch
the app everything is fine but when I press a "Back" button on emulator
nothing happens and I see a message 55435/js/main.js:9:ReferenceError: Can't find variable: tizen I looked at main.js and there's a code:

//Initialize function
var init = function () {
// TODO:: Do your initialization job
console.log("init() called");

// add eventListener for tizenhwkey
document.addEventListener('tizenhwkey', function(e) {
    if(e.keyName == "back") {
        tizen.application.getCurrentApplication().exit(); // HERE IS THE ERROR
    }
});

};
$(document).bind('pageinit', init);

A simple alert(window.tizen) said that it is undefined so I thought that some js file wasn't attached to project. Here are scripts that was generated by Tizen SDK:

<script src="tizen-web-ui-fw/latest/js/jquery.js"></script>
<script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
<script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" data-framework-theme="tizen-white"></script>
<script type="text/javascript" src="./js/main.js"></script>

I think some script should be added but I don't know which one.

Update: I'm using Tizen SDK 2.2 installed on Linux Mint 15.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

15 Replies
konduri sai swathi
Hi, Check whether hwkey event is enabled or not in the config file. If not then enable it under "tizen" tab under settings section in config.xml
Yusup Abdullaev
konduri sai swathi, Thanks for answer. hwkey is enabled but I don't think that problem is connected with that. You see, every time I want to use Tizen API I'm not able to do that since `tizen` variable is undefined. I need to work with address book in my app but I can't because `tizen` or `window.tizen` is not available.
Yusup Abdullaev
It seems that on Windows everything runs OK. So this may be either a bug or I should just try to reinstall Tizen SDK. I will update today so my question will have an answer.
Yusup Abdullaev
I reinstalled Tizen SDK, but it does nothing with error. But after that I created another workspace and it worked. So the problem is resolved.
Kirill Chuvilin
BTW do you use Web-simulator or Emulator? I have the same error in only case: on launching TizenWinset sample in Web-simulator.
Yusup Abdullaev
I'm using Emulator. The thing is when I try to start Web-Emulator it's all blank and I don't know what to do with it. So I'm using Emulator.
Tiana Sweeney
Have you added:
tizen:privilege name="http://tizen.org/privilege/tizen"/>
And/or:
feature name="http://tizen.org/api/tizen" required="true"/>
To your config.xml file? If not, try that. You should be able tot use tizen as window.tizen after adding that.
Yusup Abdullaev
Yes, it didn't help. What helped is changing workspace.
Niklas Welander

I have the exact same problem.

I have tried adding privileges like it's been said before and switching workspace, it does nothing for me.

I have reinstalled the SDK at least 5 times on 4 different installations of linux and on 4 seperate computors. All sends the same error message. The SDK was working before and then it did something stupid with the window size and other stuff were weird aswell so I reinstalled Linux. Since then I am totally unable to run the SDK.

 

I would really appreciate some help in getting the SDK to work.

log (doesn't matter which project, always the same). [Ubuntu 12.14 LTS, Web Simulator, SDK- Version : 2.2.1]

Web Simulator :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:63709
THREE.WebGLRenderer 51 ripple.js:37194
2WebGL: INVALID_OPERATION: getAttribLocation: program not linked ripple.html:1
8WebGL: INVALID_OPERATION: getUniformLocation: program not linked ripple.html:1
Attr.specified is deprecated. Its value is always true.
tizen :: Initialization Finished (Make it so.) ripple.js:63709
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
  1. getAddressBooks() error: tizen is not defined
Marco Buettner

I have the similar problem with the WinSet-Sample App, but it works on emulator and device, but on Simulator I got: ' "__tizen__" not defined.'

Fujikawa

I've experienced this problem on SDK for wearable and found this issue occurs when live editing is enabled.

But I haven't experienced on SDK not for wearable on my environment.

Aliaksiej Maroz

I have the same problem. What is the solution of it?

thomas lee

Any update? 

I have switch into a new workspace but it doesn't work.

I am trying the systemInfo sample and run as Tizen Web Simulator Application.

 

Thanks

Dominik Koleda

It seems that Linux Mint 15 doesn't like Tizen.

Also, try to use tizen. instead of window.tizen.

Anders Bergquist

Running on Windows 7, I get the same error. Tried new workspace, no luck there.

Please, Tizen developers: What to do??