Results 1 to 3 of 3

Thread: Unaltered app generated with Sencha CMD fail to load in Android as an APK

  1. #1

    Default Unaltered app generated with Sencha CMD fail to load in Android as an APK

    REQUIRED INFORMATION

    Sencha Cmd version(s) tested:

    • Sencha Cmd v4.0.3.74
    Operating System:
    • Win8.1 Pro
    Framework used:
    • Sencha Touch 2.3.1
    Description:
    • Android emulator and Android phone fail to load an APK of an unaltered application generated with the command "sencha generate app"
    Diagnostic Output:
    Code:
    C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3>sencha diag show
    Sencha Cmd v4.0.3.74
    [INF]                          app.archivePath : archive
    [INF]                            app.build.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/build/FoodInspector
    [INF]                            app.classpath : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/app.js,C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/app
    [INF]                          app.cmd.version : 4.0.3.74
    [INF]                           app.config.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3\.sencha\app
    [INF]                                  app.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3
    [INF]                            app.framework : touch
    [INF]                    app.framework.version : 2.3.1.410
    [INF]                                   app.id : f0dc20fd-d337-4f63-aa5c-dc9d25dddb63
    [INF]                        app.indexHtmlPath : index.html
    [INF]                                 app.name : FoodInspector
    [INF]                       app.requires.names :
    [INF]                    app.requires.packages :
    [INF]                       app.resource.paths :
    [INF]                     buildenvironment.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3
    [INF]                buildenvironment.load.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3
    [INF]                           cmd.config.dir : C:\Users\francois\bin\Sencha\Cmd\4.0.3.74
    [INF]                                  cmd.dir : C:\Users\francois\bin\Sencha\Cmd\4.0.3.74
    [INF]                     cmd.framework.minver : 2.2.0
    [INF]                    cmd.framework.version : 2.99.99.99999
    [INF]                             cmd.jvm.args : -Xms128m -Xmx1024m -Djava.awt.headless=true
    [INF]               cmd.merge.tool.args.araxis : -wait -merge -3 -a1 {base} {user} {generated} {out}
    [INF]               cmd.merge.tool.args.kdiff3 : {base} {user} {generated} -o {out}
    [INF]              cmd.merge.tool.args.p4merge : {base} {user} {generated} {out}
    [INF]            cmd.merge.tool.args.smartsync : {user} {generated} {base}
    [INF]           cmd.merge.tool.args.sourcegear : --merge --result={out} {user} {base} {generated}
    [INF]             cmd.merge.tool.args.tortoise : -base:{base} -theirs:{generated} -mine:{user} -merged:{out}
    [INF]                               cmd.minver : 3.0.0.0
    [INF]                             cmd.platform : windows
    [INF]                          cmd.server.port : 1841
    [INF]                              cmd.version : 4.0.3.74
    [INF]                             cmd.web.port : 1841
    [INF]                      framework.classpath : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3\touch/src
    [INF]                     framework.cmd.minver : 3.1.0.53
    [INF]                    framework.cmd.version : 4.0.2.67
    [INF]                     framework.config.dir : C:\Users\francois\bin\Sencha\Cmd\4.0.3.74\plugins\touch\2.3
    [INF]                            framework.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3\touch
    [INF]                        framework.ignores : src/locale,src/platform,auth2/Auth.js,scroller/Infinite.js
    [INF]                           framework.name : touch
    [INF]                   framework.packages.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3\touch/packages
    [INF]                        framework.version : 2.3.1.410
    [INF]                           repo.local.dir : C:\Users\francois\bin\Sencha\Cmd\repo
    [INF]         system.java.net.useSystemProxies : true
    [INF]                                touch.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/touch
    [INF]                      workspace.build.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/build
    [INF]                    workspace.cmd.version : 4.0.3.74
    [INF]                     workspace.config.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3\.sencha\workspace
    [INF]                            workspace.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3
    [INF]                   workspace.packages.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/packages
    [INF]                      workspace.theme.dir : C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\GS3/packages/${args.themeName}

    Steps to reproduce the problem:
    Code:
    sencha generate app MyApp ../MyApp
    //Testing the app in Chrome and it is working
    sencha app package generate buildConfig.json
    //Editing the config file
    sencha app package build buildConfig.json
    //Installing the APK on an Android device
    "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe" install -r C:\Users\francois\Documents\Aptana Studio 3 Workspace\resto\build\MyApp.apk"
    I tested the generated app with my Chrome browser on Windows 8.1 and the app is working.
    I did not modify the app generated with "sencha generate app MyApp ../MyApp"
    When running the app with an emulator or with a phone the app is freezing on the loading screen. (the blue screen with the dotes).


    Debugging already done:

    I tried with androidAPILevel 8 and 17.
    When using remote debbuging (http://jsconsole.com/), the only error message I get on the console is "undefined:undefined".


    Here is a copy of my buildConfig.json
    Code:
    {
        /**
         * @cfg {String} 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":"MyApp",
    
    
        /**
         * @cfg {String} 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.mycompany.myAppID",
    
    
        /**
         * @cfg {String} bundleSeedId
         * A ten character string which stands before aplication ID in Apple Provisioning Portal
         */
        "bundleSeedId":"KPXFEPZ6EF",
    
    
        /**
         * @cfg {String} versionString
         * @required
         * This is the version of your application.
         */
        "versionString":"1.0",
    
    
        /**
         * @cfg {Integer} 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 {Object} icon
         * For iOS, please refer to their documentation about icon sizes:
         * https://developer.apple.com/library/...conMatrix.html
         *
         * For Android, please refer to the Google Launcher icons guide:
         * http://developer.android.com/design/...onography.html
         *
         * iOS 7 uses 60, 76, 120, 152 (29, 58 for the Settings app; 40, 80 for Spotlight search results).
         * iOS 6.1 and earlier uses 57, 72, 114, 144 (29, 58 for the Settings app, for Spotlight search results on iPhone; 50 and 100 for Spotlight search results on iPad).
         * Android uses 36, 48, 72, 96.
         * If you package for Android you can ignore iOS icons and vice versa.
         */
        "icon": {
            "60":"resources/icons/Icon.png",
            "120":"resources/icons/[email protected]",
            "76":"resources/icons/Icon~ipad.png",
            "152":"resources/icons/[email protected]",
            "36":"resources/icons/Icon-36.png",
            "48":"resources/icons/Icon-48.png",
            "96":"resources/icons/Icon-96.png",
            "57":"resources/icons/Icon-57.png",
            "114":"resources/icons/[email protected]",
            "72":"resources/icons/Icon-72.png",
            "144":"resources/icons/[email protected]",
            "29":"resources/icons/Icon-Small.png",
            "58":"resources/icons/[email protected]",
            "40":"resources/icons/Icon-Small-40.png",
            "80":"resources/icons/[email protected]",
            "50":"resources/icons/Icon-Small-50.png",
            "100":"resources/icons/[email protected]"
        },
    
    
        /**
         * @cfg {String} inputPath
         * @required
         * This is location of your Sencha Touch 2 application, relative to this configuration file.
         */
        "inputPath":"./",
    
    
        /**
         * @cfg {String} 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":"../build/",
    
    
        /**
         * @cfg {String} 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 {String} platform
         * @required
         * This is the platform where you will be running your application. Available options are:
         *  - iOSSimulator
         *  - iOS
         *  - Android
         *  - AndroidEmulator
         */
        "platform":"AndroidEmulator",
    
    
        /**
         * @cfg {String} 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 {String} certificatePath
         * This is the location of your certificate.
         * This is required when you are developing for Android or you are developing on Windows.
         */
        "certificatePath":"../inspecteur.keystore",
    
    
        /**
         * @cfg {String} 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":"IDA",
    
    
        /**
         * @cfg {String} certificatePassword
         * The password which was specified during certificate export
         */
        "certificatePassword":"test",
    
    
        /**
         * @cfg {String} provisionProfile
         * The path to the provision profile (APP_NAME.mobileprovision) which you can create and then download from Apple's provisioning portal
         */
        "provisionProfile":"",
    
    
        /**
         * @cfg {String} URLScheme
         * URL scheme for communication with your application, can be empty if you don't use custom URL scheme in your project.
         */
        "URLScheme":"",
    
    
        /**
         * @cfg {String} notificationConfiguration
         * Notification configuration for push notifications, can be "debug", "release" or empty if you don't use push notifications in your project.
         */
        "notificationConfiguration":"",
    
    
        /**
         * @cfg {String} sdkPath
         * This is the path to the Android SDK, if you are developing an Android application.
         */
        "sdkPath":"C:/adt-bundle-windows-x86_64-20131030/sdk",
    
    
        /**
         * @cfg {String} 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/a...pi-levels.html.
         * Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android)
         */
        "androidAPILevel":"17",
    
    
        /**
        /**
         * @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/referen...KIN_PROPERTIES
         */
        "permissions":[
            "INTERNET",
            "ACCESS_NETWORK_STATE",
            "CAMERA",
            "VIBRATE",
            "ACCESS_FINE_LOCATION",
            "ACCESS_COARSE_LOCATION",
            "CALL_PHONE"
        ],
    
    
        /**
         * @cfg {Array[String]} orientations
         * @required
         * This is orientations that this application can run.
         */
        "orientations": [
            "portrait",
            "landscapeLeft",
            "landscapeRight",
            "portraitUpsideDown"
        ]
    }

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Dallas/Fort Worth
    Posts
    60

    Default Cordova

    Part part of my suggestion is what I posted here: http://www.sencha.com/forum/showthread.php?282727-Building-but-not-correctly

    It is important to understand that Sencha Command is not a tool all by itself, it depends on other tools. Specifically the following:
    • Cordova (for Native)
    • Ant
    • JDK 7
    • Ruby
    • Compass
    • MSBuild (for Windows native)
    • xcodebuild (for iOS native)
    • ADT (for Android native)
    There are a lot of things which can cause native android to not build, here are a few causes:
    • Not having Ant on the PATH
    • Not having Java 7 on the PATH
    • Not having the Java 7 SDK as the JAVA_HOME environment variable
    • I have personally had issues with Cordova 3.1 and 3.2 not working with android, unable to add the platform
    • Cordova 3.4 has the wrong location of config.xml (http://www.sencha.com/forum/showthre...-Cordova-3.4.0)
    My recommendation would be to take Sencha out of the equation, and attempt to build a pure Cordova "Hello World" application, using the debug flag:
    Code:
    cordova -d create HelloWorld com.example.hello "HelloWorld"
    cd HelloWorld
    cordova -d platform add android
    cordova -d build
    If Cordova doesn't work, Sencha Command won't work.

  3. #3

    Default

    I managed to get it work.Before running the command "sencha app package build " I had to run "sencha app build native" on my app. Now my app is working on Android

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •