Failed to install a native app into webOS(emulator)

Hi, I met a error while install a native app to webOS(qemux86), my steps are the followings:

  1. build & install webOS(./mcf -p 2 -b 2 qemux86), Building webOS OSE | webOS Open Source Edition

  2. build & install NDK(./mcf -p 2 -b 2 qemux86), Native Development Kit Setup | webOS Open Source Edition

  3. write a simple native app(just print "Hello world"), build it and package it, Developing External Native Apps | webOS Open Source Edition

  4. check what arch the executable file is
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/BUILD$ cd ..
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld$ ll
    总用量 64
    drwxrwxr-x 6 jaychou jaychou 4096 5月 17 10:23 ./
    drwxrwxr-x 4 jaychou jaychou 4096 5月 11 10:48 ../
    -rw-rw-r-- 1 jaychou jaychou 175 5月 11 10:58 appinfo.json
    drwxrwxr-x 3 jaychou jaychou 4096 5月 17 10:33 BUILD/
    -rw-rw-r-- 1 jaychou jaychou 1640 5月 11 11:03 CMakeLists.txt
    -rw-rw-r-- 1 jaychou jaychou 8928 5月 11 11:17 com.sample.helloworld_0.0.1_arm.ipk
    -rw-rw-r-- 1 jaychou jaychou 8696 5月 17 10:23 com.sample.helloworld_0.0.1_x86.ipk
    -rw-rw-r-- 1 jaychou jaychou 2375 4月 19 10:29 icon.png
    drwxrwxr-x 2 jaychou jaychou 4096 5月 11 11:17 pkg_arm/
    drwxrwxr-x 2 jaychou jaychou 4096 5月 17 10:34 pkg_x86/
    -rw-rw-r-- 1 jaychou jaychou 1626 4月 19 10:29 README.md
    drwxrwxr-x 2 jaychou jaychou 4096 5月 11 20:42 src/
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld$ cd pkg_x86/
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ ll
    总用量 32
    drwxrwxr-x 2 jaychou jaychou 4096 5月 17 10:34 ./
    drwxrwxr-x 6 jaychou jaychou 4096 5月 17 10:23 ../
    -rw-rw-r-- 1 jaychou jaychou 175 5月 11 10:58 appinfo.json
    -rwxrwxr-x 1 jaychou jaychou 13100 5月 17 10:34 helloworld*
    -rw-rw-r-- 1 jaychou jaychou 2375 4月 19 10:29 icon.png
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ file helloworld
    helloworld: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=e9ce17cdf9076f6d5ad5e08a503a0f61998af63b, with debug_info, not stripped

  5. check if it can run
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ ./helloworld
    Hello world!jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ ^C

  6. package it to IPK
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ cd ..
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld$ ares-package pkg_x86/
    Create com.sample.helloworld_0.0.1_x86.ipk to /home/jaychou/samples/native-apps/external/com.sample.helloworld
    Success

  7. install to webOS emualter but failed
    PS C:\Users\1> ares-install.cmd E:\VirtualBox\Ubuntu\share\com.sample.helloworld_0.0.1_x86.ipk
    Installing package E:\VirtualBox\Ubuntu\share\com.sample.helloworld_0.0.1_x86.ipk
    ares-install ERR!

The logs are the following:
ares-install verb installer#install(): lineObj: {"id":"com.ares.defaultName","statusValue":24,"details":{"receivedSize":"0","packageId":"com.sample.helloworld","modifiedTime":"","unpackFileSize":"45826","client":"com.webos.lunasendpub-1128","totalSize":"0","verified":false,"progress":100,"errorCode":-5,"installBasePath":"/media/developer","reason":"FAILED_IPKG_INSTALL","downgrade":true,"paused":false,"simpleStatus":"install","state":"install failed","update":false,"ipkFile":"/media/developer/temp/com.sample.helloworld_0.0.1_arm.ipk"}}
ares-install verb installer#install(): failure
ares-install verb luna#send() Error
ares-install verb luna#send() at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)
ares-install verb luna#send() at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)
ares-install verb luna#send() at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46
ares-install verb luna#send() at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)
ares-install verb luna#send() at Array.forEach ()
ares-install verb luna#send() at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)
ares-install verb luna#send() at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)
ares-install verb luna#send() at Channel.emit (events.js:182:13)
ares-install verb luna#send() at addChunk (_stream_readable.js:287:12)
ares-install verb luna#send() at readableAddChunk (_stream_readable.js:268:11)
ares-install verb luna#send() err: { Error
ares-install verb luna#send() at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)
ares-install verb luna#send() at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)
ares-install verb luna#send() at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46
ares-install verb luna#send() at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)
ares-install verb luna#send() at Array.forEach ()
ares-install verb luna#send() at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)
ares-install verb luna#send() at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)
ares-install verb luna#send() at Channel.emit (events.js:182:13)
ares-install verb luna#send() at addChunk (_stream_readable.js:287:12)
ares-install verb luna#send() at readableAddChunk (_stream_readable.js:268:11)
ares-install verb luna#send() message: 'luna-send command failed <FAILED_IPKG_INSTALL>',
ares-install verb luna#send() stack:
ares-install verb luna#send() 'Error\n at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)\n at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)\n at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46\n at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)\n at Array.forEach ()\n at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)\n at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)\n at Channel.emit (events.js:182:13)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)' } value: undefined
ares-install verb luna#send() closing exec stream
ares-install verb installer#waterfall callback err: Error
ares-install verb installer#waterfall callback err: at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)
ares-install verb installer#waterfall callback err: at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)
ares-install verb installer#waterfall callback err: at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46
ares-install verb installer#waterfall callback err: at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)
ares-install verb installer#waterfall callback err: at Array.forEach ()
ares-install verb installer#waterfall callback err: at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)
ares-install verb installer#waterfall callback err: at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)
ares-install verb installer#waterfall callback err: at Channel.emit (events.js:182:13)
ares-install verb installer#waterfall callback err: at addChunk (_stream_readable.js:287:12)
ares-install verb installer#waterfall callback err: at readableAddChunk (_stream_readable.js:268:11)
ares-install verb installer#waterfall callback err: { Error
ares-install verb installer#waterfall callback err: at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)
ares-install verb installer#waterfall callback err: at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)
ares-install verb installer#waterfall callback err: at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46
ares-install verb installer#waterfall callback err: at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)
ares-install verb installer#waterfall callback err: at Array.forEach ()
ares-install verb installer#waterfall callback err: at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)
ares-install verb installer#waterfall callback err: at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)
ares-install verb installer#waterfall callback err: at Channel.emit (events.js:182:13)
ares-install verb installer#waterfall callback err: at addChunk (_stream_readable.js:287:12)
ares-install verb installer#waterfall callback err: at readableAddChunk (_stream_readable.js:268:11)
ares-install verb installer#waterfall callback err: message: 'luna-send command failed <FAILED_IPKG_INSTALL>',
ares-install verb installer#waterfall callback err: stack:
ares-install verb installer#waterfall callback err: 'Error\n at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)\n at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)\n at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46\n at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)\n at Array.forEach ()\n at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)\n at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)\n at Channel.emit (events.js:182:13)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)' }
ares-install ERR! CLI: luna-send command failed <FAILED_IPKG_INSTALL>
ares-install verb Error
at new CLIError (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:118:22)
at Object.errMsgHdlr.changeErrMsg (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\error-handler.js:113:16)
at F:\Node\npm-global\node_modules@webosose\ares-cli\lib\install.js:231:46
at _onLine (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:92:25)
at Array.forEach ()
at _onData (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\luna.js:74:36)
at Channel. (F:\Node\npm-global\node_modules@webosose\ares-cli\lib\base\novacom.js:919:56)
at Channel.emit (events.js:182:13)
at addChunk (_stream_readable.js:287:12)
at readableAddChunk (_stream_readable.js:268:11)
ares-install verb luna#send() JSON line:
ares-install verb Clear Session
ares-install verb Session#end() user-requested termination

I am at a loss currently as to what should I do, any help would be appreciated,
Thank you in advance.

My demo native app is very simple.

  1. Source file 'main.c' are as follows:
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/src$ ll
    总用量 12
    drwxrwxr-x 2 jaychou jaychou 4096 5月 17 13:57 ./
    drwxrwxr-x 6 jaychou jaychou 4096 5月 17 10:35 ../
    -rw-rw-r-- 1 jaychou jaychou 787 5月 11 10:50 main.c
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/src$ cat main.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
fprintf(stdout, "Hello world!");
exit(0);
}

  1. CMakeLists.txt are as follows:
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld$ cat CMakeLists.txt

cmake_minimum_required(VERSION 2.8.7)
project(helloworld C CXX)

include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/include)

set(BIN_NAME helloworld)

set(SRC_LIST
${CMAKE_SOURCE_DIR}/src/main.c
)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/pkg_$ENV{ARCH}/")
add_executable(${BIN_NAME} ${SRC_LIST})
set_target_properties(${BIN_NAME} PROPERTIES LINKER_LANGUAGE C)

target_link_libraries (${BIN_NAME}
)

if(EXISTS "${CMAKE_SOURCE_DIR}/appinfo.json")
file(COPY "${CMAKE_SOURCE_DIR}/appinfo.json" DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
else()
MESSAGE( "'appinfo.json' file was not found !!")
endif()

if(EXISTS "${CMAKE_SOURCE_DIR}/icon.png")
file(COPY "${CMAKE_SOURCE_DIR}/icon.png" DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
else()
MESSAGE( "'icon.png' file was not found !!")
endif()

  1. appinfo.json are as follows:
    jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld$ cat appinfo.json
    {
    "id": "com.sample.helloworld",
    "version": "0.0.1",
    "vendor": "My Company",
    "type": "native",
    "main": "helloworld",
    "title": "helloworld",
    "icon": "icon.png"
    }

  2. Check whether the app is valid and it show 'no problems detected'

jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ ll
总用量 32
drwxrwxr-x 2 jaychou jaychou 4096 5月 17 10:34 ./
drwxrwxr-x 6 jaychou jaychou 4096 5月 17 10:35 ../
-rw-rw-r-- 1 jaychou jaychou 175 5月 17 10:35 appinfo.json
-rwxrwxr-x 1 jaychou jaychou 13100 5月 17 10:34 helloworld*
-rw-rw-r-- 1 jaychou jaychou 2375 4月 19 10:29 icon.png
jaychou@jaychou-VirtualBox:~/samples/native-apps/external/com.sample.helloworld/pkg_x86$ ares-package -c
no problems detected

Eveything seems normal, and I don't know why it failed when installing...

@initialjie ,

This error is similar to Failed to install a native app into webOS(emulator).

So it also will be fixed in OSE 2.11.0 release.

It need more time to figure out.

If we fix this error, we'll let you know in this post.

Thanks!

Long time no see!

This issue was resolved in webOS OSE build #359.
You can check the resolved version in webOS OSE 2.11.0 release. :grin: (at the end of June)

Thanks for reporting the issue and have a nice day!