PDA

View Full Version : Failed to run a simple native app packaged by Sencha Cmd



raymondlee
2 Dec 2013, 6:42 AM
I was following the guide to package a very simple app for android, but somehow it did not work. My project is really very simple, here is my app.js looks like:


Ext.application({
name: 'Sencha',


launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
tabBarPosition: 'bottom',


items: [
{
title: 'Home',
iconCls: 'home',
html: [
'<img src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Welcome to Sencha Touch</h1>',
"<p>You're creating the Getting Started app. This demonstrates how ",
"to use tabs, lists, and forms to create a simple app</p>",
'<h2>Sencha Touch</h2>'
].join("")
}
]
});
}
});


It works fine when I run it on my PC using IIS as a webserver, but after I packaged my App to a native one and run it on an android device, my screen just hangs on this:
47069

I did all this on my PC, running Windows 8, Sencha Cmd v4.0.0.203, ruby 1.9.3p448.
I found a similar thread here: http://www.sencha.com/forum/showthread.php?238441-App-hangs-at-three-dots-blinking-screen but the solution mentioned in this thread does't work for me.

fmoseley
3 Dec 2013, 6:51 PM
Run your app as a web app and check the console for errors or warnings?
What command did you use to package your application?
What does your packager.json look like?

You should also run 'sencha upgrade' to upgrade to Cmd v. 4.0.1.45
And 'sencha app upgrade --noframework' to upgrade your app cmd bits

raymondlee
4 Dec 2013, 7:04 AM
I already upgrade sencha cmd to v4.0.1.45, but it is still not working.

When I run my app as web app, it works fine, no error or warnings.

I used this command to package my app:
sencha app package run packager.json

here is my packager.json file:


{
/**
* @cfg applicationName
* @required
* This is the name of your application, which is displayed on the device when the app is installed. On IOS, this should match
* the name of your application in the Apple Provisioning Portal.
*/
"applicationName":"testApp",


/**
* @cfg applicationId
* This is the name namespace for your application. On IOS, this should match the name of your application in the Apple Provisioning Portal.
*/
"applicationId":"com.android.testApp",


/**
* @cfg bundleSeedId
* A ten character string which stands before aplication ID in Apple Provisioning Portal
*/
"bundleSeedId":"KPXFEPZ6EF",


/**
* @cfg versionString
* @required
* This is the version of your application.
*/
"versionString":"1.0",


/**
* @cfg versionCode
* @required
* This is the integer version code of your application, or you can refer to it as a build number. Used only for Android builds.
*/
"versionCode":"1",


/**
* @cfg icon
* For iOS, please refer to their documentation about icon sizes:
* https://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html
*
* For Android, please refer to the Google Launcher icons guide:
* http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
* iOS uses 57, 72, 114 and 144; Android uses 36, 48 and 72; if you package for Android you can ignore iOS icons and vice verca
*/
"icon": {
"36":"resources/icons/Icon_Android36.png",
"48":"resources/icons/Icon_Android48.png",
"57":"resources/icons/Icon.png",
"72":"resources/icons/Icon~ipad.png",
"114":"resources/icons/Icon@2x.png",
"144":"resources/icons/Icon~ipad@2x.png"
},


/**
* @cfg inputPath
* @required
* This is location of your Sencha Touch 2 application, relative to this configuration file.
*/
"inputPath":"./",


/**
* @cfg outputPath
* @required
* This is where the built application file with be saved. Make sure that output path is not in your input path, you may get into endless recursive copying
*/
"outputPath":"C:/inetpub/wwwroot/build/testApp",


/**
* @cfg configuration
* @required
* This is configuration for your application. `Debug` should always be used unless you are submitting your app to an online
* store - in which case `Release` should be specified.
*/
"configuration":"Debug",


/**
* @cfg platform
* @required
* This is the platform where you will be running your application. Available options are:
* - iOSSimulator
* - iOS
* - Android
* - AndroidEmulator
*/
"platform":"AndroidEmulator",


/**
* @cfg deviceType
* @required
* This is device type that your application will be running on.
*
* If you are developing for Android, this is not necessary.
*
* Available options are:
* - iPhone
* - iPad
* - Universal
*/
"deviceType":"Universal",


/**
* @cfg certificatePath
* This is the location of your certificate.
* This is required when you are developing for Android or you are developing on Windows.
*/
"certificatePath":"F:/Android/SDK/certificate/android1.keystore",


/**
* @cfg certificateAlias
* This is the name of your certificate.
*
* IF you do not specify this on OSX, we will try and automatically find the certificate for you using the applicationId.
*
* This can be just a simple matcher. For example, if your certificate name is "iPhone Developer: Robert Dougan (ABCDEFGHIJ)", you
* can just put "iPhone Developer".
*
* When using a certificatePath on Windows, you do not need to specify this.
*/
"certificateAlias":"android1",
/**
* @cfg certificatePassword
* The password which was specified during certificate export
*/
"certificatePassword":"android1",
/**
* @cfg provisionProfile
* The path to the provision profile (APP_NAME.mobileprovision) which you can create and then download from Apple's provisioning portal
*/
"provisionProfile":"",
/**
* @cfg notificationConfiguration
* Notification configuration for push notifications, can be "debug", "release" or empty if you don't use push notifications in your project.
*/
"notificationConfiguration":"",
/**
* @cfg sdkPath
* This is the path to the Android SDK, if you are developing an Android application.
*/
"sdkPath":"F:/Android/SDK/sdk",


/**
* @cfg androidAPILevel
* This is android API level, the version of Android SDK to use, you can read more about it here: http://developer.android.com/guide/appendix/api-levels.html.
* Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android)
*/
"androidAPILevel":"8",


/**
* @cfg {Array[String]} permissions
* Array of permissions that is used by an application (Android only)
* Full list of permissions for Android application can be found here: http://developer.android.com/reference/android/Manifest.permission.html#ACCESS_CHECKIN_PROPERTIES
*/
"permissions":[
"INTERNET",
"ACCESS_NETWORK_STATE"
],


/**
* @cfg {Array[String]} orientations
* @required
* This is orientations that this application can run.
*/
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}




please help to fix this, thanks.

fmoseley
7 Dec 2013, 6:06 PM
Try using 'sencha app build native' instead there is a bug open for the command you are using.
http://www.sencha.com/forum/showthread.php?275389

raymondlee
7 Dec 2013, 8:34 PM
fmoseley,

thanks you for your help, "sencha app build native" does work for me.
thank you very much.