4

I followed all the steps in the basic Phonegap tutorial (Eclipse, Android SDK, ADT Phonegap), I created an index.html page (code from phonegap site) and cordova-2.2.0.js in the assets/www folder and cordova-2.2.0.jar, when i ran it it showed this message on the consol screen :

[2013-09-05 12:44:14 - phonegape-test] ------------------------------
[2013-09-05 12:44:14 - phonegape-test] Android Launch!
[2013-09-05 12:44:14 - phonegape-test] adb is running normally.
[2013-09-05 12:44:14 - phonegape-test] No Launcher activity found!
[2013-09-05 12:44:14 - phonegape-test] The launch will only sync the application package on the device!
[2013-09-05 12:44:14 - phonegape-test] Performing sync
[2013-09-05 12:44:14 - phonegape-test] Automatic Target Mode: launching new emulator with compatible AVD 'STest'
[2013-09-05 12:44:14 - phonegape-test] Launching a new emulator with Virtual Device 'STest'
[2013-09-05 12:44:27 - phonegape-test] New emulator found: emulator-5554
[2013-09-05 12:44:27 - phonegape-test] Waiting for HOME ('android.process.acore') to be launched...
[2013-09-05 12:46:25 - phonegape-test] HOME is up on device 'emulator-5554'
[2013-09-05 12:46:25 - phonegape-test] Uploading phonegape-test.apk onto device 'emulator-5554'
[2013-09-05 12:46:26 - phonegape-test] Installing phonegape-test.apk...
[2013-09-05 12:47:35 - phonegape-test] Success!
[2013-09-05 12:47:35 - phonegape-test] \phonegape-test\bin\phonegape-test.apk installed on device
[2013-09-05 12:47:35 - phonegape-test] Done!

but the application dose not work and i did not found my application lancher icon ! can u help me please !

EDIT : MainActivity.java :

package com.example.phonegape;

import android.os.Bundle;
import android.view.Menu;
import org.apache.cordova.*;
//import com.phonegap.DroidGap;

public class MainActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.init();
        super.loadUrl("file:///assets/www/index.html");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}
4
  • What do you mean by "doesn't work"? Is there any blank screen or something? The app breaks? Please specify.
    – Math
    Commented Sep 5, 2013 at 12:05
  • there is no blank screen and there is no app breaks! the emulator was launched and nothing was happening
    – Nomade
    Commented Sep 5, 2013 at 12:08
  • Can you post your activity? (I guess you have only one, right?)
    – Math
    Commented Sep 5, 2013 at 12:17
  • yes i have just one. take look to myMainActicity.java i added it in my question !
    – Nomade
    Commented Sep 5, 2013 at 14:35

4 Answers 4

1

I know your index.html is placed in the assets folder, but try to change the super.loadUrl line to:

super.loadUrl("file:///android_asset/www/index.html");

As per this tutorial PhoneGap Documentation - Getting Started with Android

0
0

you have to keep trying until your console says "installing", one might work is that run one emulator and then if nothing happens, leave that on and start another run with a second emulator, sometimes that does the trick. adt emulator sucks in general though, get a cheap android phone my advice.

0
0
  1. Are you looking at the correct AVD - ?

  2. Can you check if there is any problems with the project. Check the "Problems" view

    Window -> Show View -> Problems or Window -> Show View -> Others-> Problems

  3. Try to fix the android properties : Right click project -> Android tools -> Fix project properties


By cleaning project it means select
Steps:
    1. Select the menu Project->Clean
    2. Build Project: Project -> Build
1
  • i did. still have this message in red when i lanche the application on the emulator : [2013-09-05 16:34:27 - phonegape-test] No Launcher activity found! [2013-09-05 16:34:27 - phonegape-test] The launch will only sync the application package on the device!
    – Nomade
    Commented Sep 5, 2013 at 15:36
0

Sometimes the app icon doesn't show up in the Emulator. You can try one of the options below:

  1. Have the Emulator open, try launching the application again in the same emulator.

  2. Clean all the projects, and try to wipe all the data in the emulators (option should be there in AVD manager) and then Build the only project which you will require to test. The application icon should be there DEFINITELY in the emulator.

  3. Have Emulator configurations low. Don't have high end Emulator Configurations. Mine read as 500 MB RAM and 64 VM Heap. Internal Storage should be 200. Run it on Intel Processor for recent Android versions rather than ARM processors. You will get Hex error in Console, if you haven't enabled Virtualization in Bios. But, don't bother about that. You can check previously answered questions reg this, if you still feel you need to know.

Let me know, if this works. I had faced issues and one among the above solutions definitely resolves it!

Thanks!

4
  • thanks for the reply, the first solution does not work. for the second I closed all other projects and it's not working ! I don't understand what do you mean by "Clean all the projects"
    – Nomade
    Commented Sep 5, 2013 at 14:29
  • 1
    In Eclipse uncheck Build Automatically option in the Project menu. Then select, Project-> Clean Project, In the window which appears, select only the project which you want to clean and build the selected projects. After or Before that however please look in for wiping all the user data in Emulator or better start a new Device Emulator, and try executing your project in that emulator.
    – Manikandan
    Commented Sep 5, 2013 at 16:00
  • @nomade added a third option...can you please check with that too..?
    – Manikandan
    Commented Sep 5, 2013 at 16:06
  • and one more thing, which tutorial did you follow for creating the index.html..? there are two tutorials out there, one through commandline mentioned in phonegap site and the other through adobe site. If you have followed the commandline process and hadn't played with anything other than modifying index.html, you needn't worry. If yu did follow adobe site's method, it's too lengthy and might lead to some problems..
    – Manikandan
    Commented Sep 5, 2013 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.