-
24 Apr 2012 2:57 AM #1
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
-
24 Apr 2012 4:25 AM #2
Yes, in your src folder under your .java file.. you probably need to change the index.html reference to app.html (see example)
and make sure the path is the same..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"); } }
path.png
-
25 Apr 2012 12:55 AM #3
what java file? i can't find any reference on
file:///android_asset/www/app.html
-
25 Apr 2012 3:34 AM #4
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..
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..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"); } }
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..
-
26 Apr 2012 5:11 AM #5
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!!
-
26 Apr 2012 5:18 AM #6
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
-
26 Apr 2012 4:11 PM #7
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!!
-
13 May 2012 1:40 PM #8
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!


Reply With Quote