1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    siriusb is on a distinguished road

      0  

    Default deploing apk error

    deploing apk error


    hello! i am new to sencha and i try to export an apk from architect.
    the build is done (some times i get errors but after changing some paths it finaly works) and i get the apk.
    when i move it to my phone i get a browser error.

    Web page not available
    the web page at file://android.asset/index.html could ot be loaded as:

    index.html not found

    any ideas?
    i build at api 7.
    and i have moved my android folder inside my local server folder.
    thanx

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default


    Yes, in your src folder under your .java file.. you probably need to change the index.html reference to app.html (see example)

    Code:
    package lnv.sencha.Touch2_MVC;
    
    import com.phonegap.*;
    import android.os.Bundle;
    
    public class Touch2_MVC extends DroidGap {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            super.loadUrl("file:///android_asset/www/app.html");
        }
    }
    and make sure the path is the same..

    path.png

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    siriusb is on a distinguished road

      0  

    Default


    what java file? i can't find any reference on
    file:///android_asset/www/
    app.html


  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default


    I'm still in the process of learning architect myself.. so I understand this is suppose to create an .apk right from Architect?.. very sweet, I will have to try that. Sorry about the earlier confusion.

    I assumed that you created an android package (apk) using something like "phonegap for android" ? since you deployed this to your phone.
    This automatically creates the "activity" java file.. which will look something like this..

    Code:
    package abc.some.name;
    
    import com.phonegap.*;
    import android.os.Bundle;
    
    public class TestActivity extends DroidGap {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            super.loadUrl("file:///android_asset/www/index.html");
        }
    }
    You will point the super.loadURL to the html file that launches your application.. So when you create your project using Architect and wrap it up in a .apk.., it can be deployed as an android app..

    For more information google "phonegap for android"

    I use eclipse IDE with the phonegap for android plugin and it does works well, but I will give Architect a whirl when I get a chance, to do this for me..

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    26
    Vote Rating
    0
    pulliags is on a distinguished road

      0  

    Default


    Having the same issue...I've created the apk, but when installed on a device I get

    "Web page not available" The web page at file:///android_asset/index.html could not be loaded as:
    The requested file was not found.
    index.html

    Is there a setting that needs to be changed or a solution to this issue?

    Thanks!!

  6. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default


    http://www.sencha.com/forum/showthre...issue&p=788733

    =======================================================
    My guess, since I have not done this yet.. is that when your apk file is created it is automated to launch a index.html file

    file:///android_asset/index.html

    But Architect does not create an index.html file, but a app.html file
    Is there a point where you can change your app.html to index.html before trying to create your apk ?
    Last edited by DracisFL; 26 Apr 2012 at 6:37 AM. Reason: add link to same problem

  7. #7
    Sencha User
    Join Date
    Sep 2011
    Posts
    26
    Vote Rating
    0
    pulliags is on a distinguished road

      0  

    Default


    Thanks!! I was able to get this to work, but not how I would want to do it every time. What you suggested is exactly what I tried. After creating the application in A2, I changed the name of the app.html file to index.html. I then went back in to A2 and packaged the application creating the apk file. Then of course I copied the apk file to the Android phone. Worked like a charm, but I don't want to have to change the app.html file to index.html every time I need to create the apk. If anyone knows of a solution, please post it. Thanks for your help!!

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    jwebuser is on a distinguished road

      0  

    Default


    Hi siriusb,

    today I had the same problem (the same error message) as you.
    I do not work with Sencha Architect but create my apk-files from the command-line.

    Looking inside of the generated apk-file I discovered, that it did not contain the 'assets'-folder containing all the sencha stuff.
    Totally crazy how this can happen...
    My problem was that I just used the wrong command.
    The wrong(!) command was 'sencha package build packager.json'.

    Here my solution:
    Navigate to the root of your Sencha project and do this command:
    sencha app build package
    just to package your applicaton or
    sencha app build native
    to package your application with apk-file to be deployed later in your emulator or on your mobile device.
    That solved my problem!

    More details for this solution can be found here:
    http://docs.sencha.com/touch/2-0/#!/guide/command


    Good luck for you!