1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    177
    Vote Rating
    9
    huberte will become famous soon enough

      0  

    Default Unable to run apk

    Unable to run apk


    Hi, I'm under s 2.1 and cmd 250,

    I did everything right (I suppose)

    I did run run on localhost : no error, no warning on console

    I did buil testing : no error, running fine, no error on console

    When I build production (build a new sencha project, clean folder), no errors, when I run the projetc

    Code:
    Error evaluating http://www.mydomain.com/app/myapp/app.js with message: SyntaxError: Unexpected identifier www.mydomain.com:64
    G
    Here is the G function, copied from developper tools :

    Code:
    f=e.iframe,f.contentWindow===a){e.callback(b);k.body.removeChild(f);m.splice(c,1);break}}function G(a){"undefined"!=typeof console&&(console.error||console.log).call(console,a)}function t(a,b){try{n.setItem(a,b)}catch(c){if(c.code==c.QUOTA_EXCEEDED_ERR&&q){var d=q.assets.map(function(a){return a.key}),e=0,f=n.length,l=!1,j;for(d.push(q.key);e<=f-1;)j=n.key(e),-1==d.indexOf(j)?(n.removeItem(j),l=!0,f--):e++;l&&t(a,b)}}}function u(a){try{return n.getItem(a)}catch(d){return null}}function M(){H||(H=
    Reloading and the app runs fine

    Code:
    Document was loaded from Application Cache with manifest http://www.mydomain.com/app/myapp/cache.appcache
    Application Cache Checking event
    Application Cache NoUpdate event

    When I build apk, no errors, stuck on the loading screen...

    Here is the debug log from the sencha package build :

    Code:
    D:\wamp\www\myapp>sencha --debug package build and.jsonSencha Cmd v3.0.0.250
    [DBG]           using path C:\apps\SenchaCMD\Sencha\Cmd\3.0.0.250\stbuild;C:\apps\SenchaCMD\Sencha\Cmd\3.0.0.250\stbuild\bin;C:\apps\SenchaCMD\Sencha\Cmd\3.0.0.250;C:\apps\Ruby\bin;C:\Windows\system32
    ;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\apps\java\jdk\bin;C:\Program Files (x86)\MiKTeX 2.9\mikt
    ex\bin\;C:\Program Files\nodejs\;C:\apps\apache-ant-1.8.4\bin;C:\apps\npm\
    [DBG]           executable located at C:\apps\SenchaCMD\Sencha\Cmd\3.0.0.250\stbuild\stbuild.exe
    [DBG]           using workding directory .
    Created project directory: D:\Application\app\myapp
    Created directory D:\Application\app\myapp\src\com\myapp\com
    Added file D:\Application\app\myapp\src\com\myapp\com\STActivity.java
    Created directory D:\Application\app\myapp\res
    Created directory D:\Application\app\myapp\bin
    Created directory D:\Application\app\myapp\libs
    Created directory D:\Application\app\myapp\res\values
    Added file D:\Application\app\myapp\res\values\strings.xml
    Created directory D:\Application\app\myapp\res\layout
    Added file D:\Application\app\myapp\res\layout\main.xml
    Added file D:\Application\app\myapp\AndroidManifest.xml
    Added file D:\Application\app\myapp\build.xml
    Added file D:\Application\app\myapp\proguard-project.txt
    Buildfile: D:\Application\app\myapp\build.xml
    
    
    -set-mode-check:
    
    
    -set-debug-files:
    
    
    -check-env:
     [checkenv] Android SDK Tools Revision 20.0.3
     [checkenv] Installed at C:\apps\android-sdk
    
    
    -setup:
         [echo] Project Name: myapp2012
      [gettype] Project Type: Application
    
    
    -set-debug-mode:
    
    
    -debug-obfuscation-check:
    
    
    -build-setup:
         [echo] Resolving Build Target for myapp2012...
    [gettarget] Project Target:   Android 2.3.3
    [gettarget] API level:        10
         [echo] ----------
         [echo] Creating output directories if needed...
        [mkdir] Created dir: D:\Application\app\myapp\bin\res
        [mkdir] Created dir: D:\Application\app\myapp\gen
        [mkdir] Created dir: D:\Application\app\myapp\bin\classes
         [echo] ----------
         [echo] Resolving Dependencies for myapp2012...
    [dependency] Library dependencies:
    [dependency] No Libraries
    [dependency]
    [dependency] ------------------
    [dependency] API<=15: Adding annotations.jar to the classpath.
         [echo] ----------
         [echo] Building Libraries with 'debug'...
       [subant] No sub-builds to iterate on
    
    
    -pre-build:
    
    
    -code-gen:
    [mergemanifest] Merging AndroidManifest files into one.
    [mergemanifest] Manifest merger disabled. Using project manifest only.
         [echo] Handling aidl files...
         [aidl] No AIDL files to compile.
         [echo] ----------
         [echo] Handling RenderScript files...
    [renderscript] No RenderScript files to compile.
         [echo] ----------
         [echo] Handling Resources...
         [aapt] Generating resource IDs...
         [echo] ----------
         [echo] Handling BuildConfig class...
    [buildconfig] Generating BuildConfig class.
    
    
    -pre-compile:
    
    
    -compile:
        [javac] Compiling 3 source files to D:\Application\app\myapp\bin\classes
    
    
    -post-compile:
    
    
    -obfuscate:
    
    
    -dex:
          [dex] Converting compiled files and external libraries into D:\Application\app\myapp\bin\classes.dex...
    
    
    -crunch:
       [crunch] Crunching PNG Files in source dir: D:\Application\app\myapp\res
       [crunch] To destination dir: D:\Application\app\myapp\bin\res
       [crunch] Processing image to cache: D:\Application\app\myapp\res\drawable-hdpi\icon.png => D:\Application\app\myapp\bin\res\drawable-hdpi\icon.png
       [crunch]   (processed image to cache entry D:\Application\app\myapp\bin\res\drawable-hdpi\icon.png: 55% size of source)
       [crunch] Processing image to cache: D:\Application\app\myapp\res\drawable-ldpi\icon.png => D:\Application\app\myapp\bin\res\drawable-ldpi\icon.png
       [crunch]   (processed image to cache entry D:\Application\app\myapp\bin\res\drawable-ldpi\icon.png: 0% size of source)
       [crunch] Processing image to cache: D:\Application\app\myapp\res\drawable-mdpi\icon.png => D:\Application\app\myapp\bin\res\drawable-mdpi\icon.png
       [crunch]   (processed image to cache entry D:\Application\app\myapp\bin\res\drawable-mdpi\icon.png: 0% size of source)
       [crunch] Crunched 3 PNG files to update cache
    
    
    -package-resources:
         [aapt] Creating full resource package...
         [aapt]     (skipping dir '.sencha' due to ANDROID_AAPT_IGNORE pattern '.*')
         [aapt]     (skipping dir '.sass-cache' due to ANDROID_AAPT_IGNORE pattern '.*')
    
    
    -package:
    [apkbuilder] Current build type is different than previous build: forced apkbuilder run.
    [apkbuilder] Creating myapp2012-debug-unaligned.apk and signing it with a debug key...
    
    
    -post-package:
    
    
    -do-debug:
     [zipalign] Running zip align on final apk...
         [echo] Debug Package: D:\Application\app\myapp\bin\myapp2012-debug.apk
    [propertyfile] Creating new property file: D:\Application\app\myapp\bin\build.prop
    [propertyfile] Updating property file: D:\Application\app\myapp\bin\build.prop
    [propertyfile] Updating property file: D:\Application\app\myapp\bin\build.prop
    [propertyfile] Updating property file: D:\Application\app\myapp\bin\build.prop
    
    
    -post-build:
    
    
    debug:
    
    
    BUILD SUCCESSFUL
    Total time: 20 seconds
    Warning: config file does not contain any application permissions, please verify application does not access any hardware features like camera, GPS, etc
    ""C:/apps/android-sdk\tools\android" create project --target android-10 --name myapp2012 --activity STActivity --path "D:/Application/appl/\/" --package com.myapp.com
    "
    [DBG]           exit code was : 0
    [DBG]           exit code was : 0


    What else could I do to check where the errors is ? What should I do ?

    I did try weinre :
    http://www.sencha.com/forum/showthread.php?245969-Debug-an-app-with-weinre

    but nobody could explained to me how to proper use it, since it doesn't work in index.html :


    Code:
    </style>    <script src="http://192.168.0.10:8080/target/target-script-min.js#anonymous"></script>    <!-- The line below must be kept intact for Sencha Command to build your application -->    <script id="microloader" type="text/javascript" src="touch/microloader/development.js"></script>

    Edit: weinre works with the web-app on android phone (wamp server), not working with app pack in apk
    Last edited by huberte; 17 Nov 2012 at 10:39 PM. Reason: adding weinre details and apk build details

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    177
    Vote Rating
    9
    huberte will become famous soon enough

      0  

    Default


    OK, it's a bit tricky but it's working. Since there is no explanation how to run weinre in an apk (an easy one with a line of code :! )

    I did unpack the apk package and ran it on a server, there I saw errors not showing up in testing and production (typo with lower/upper case in requirements)

    Anyway if someone have a solution for weinre...

Tags for this Thread