Unable to run the emulator on ionic?


#1

Hello

i am unable to test my app on the emulator as i keep getting the below error message

This is my configuration for AVD

What should i change? i cant find the problem

Thanks in advance


#2

Where is the problem? (Besides the unused import…)
That output looks fine to me - no device found, so it uses emulator. No emulator specified, so it uses one that is there. Then it tries to start the emulator. Didn’t it appear?


#3

It does Appear, but the issue is i cannot see my app in it :frowning:

Also my App needs Facebook app installed and i cannot get that in too

May be i am unclear on how to install my app on the emulator, can you please help me with that


#4

You run the command, emulator starts up with your app in it.


#5

Yeah that is what i thought, but i cannot see my app in the Emulator. i have no logs in the emulator as well (or dont know where to see what went wrong)

Any Thoughts?


#6

What is your ionic info output?
Check the list of installed software on the emulator manually. Is your app one of them?


#7

Hi Sujan

ok this time i use build then did emulate, now i have a Icon in the middle for my App so that was good

when i run it i first launch the emulator i get this error

the above may be a system issue but when i click on my app i get this error

looks like its trying to get something from the assets and cannot get it.

any idea how to fix tihs?

Saeed


#8

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.

This happens a lot with older devices that are quite slow. Try rebooting it.


#9

Thank you so much

Can you please suggest me which which android image I should emulate on

Do you know one that generally works?

Thank you again


#11

Also its a bit of hit and miss i did managed to get something in the end

i get this

i cant tell if its a problem or just log, can you tell?


#13

Next what i tried is to use the old S4 i had lying around

i am able to see a error on the inspect now
"Uncaught SyntaxError: Use of future reserved word in strict mode "

i dont know where it is comming from

my package.json is

{
    "name": "ionic-hello-world",
    "version": "0.0.0",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.0.2",
        "@angular/compiler": "4.0.2",
        "@angular/compiler-cli": "4.0.2",
        "@angular/core": "4.0.2",
        "@angular/forms": "4.0.2",
        "@angular/http": "4.0.2",
        "@angular/platform-browser": "4.0.2",
        "@angular/platform-browser-dynamic": "4.0.2",
        "@ionic-native/camera": "^3.12.1",
        "@ionic-native/core": "^3.7.0",
        "@ionic-native/facebook": "^3.12.1",
        "@ionic-native/geolocation": "^3.7.0",
        "@ionic-native/in-app-browser": "^3.11.0",
        "@ionic-native/splash-screen": "3.4.2",
        "@ionic-native/status-bar": "3.4.2",
        "@ionic/cloud-angular": "^0.12.0",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-camera": "^2.4.1",
        "cordova-plugin-compat": "^1.0.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-facebook4": "^1.7.4",
        "cordova-plugin-geolocation": "^2.4.3",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.1",
        "cordova-plugin-whitelist": "^1.3.1",
        "ionic-angular": "3.1.1",
        "ionic-plugin-deploy": "^0.6.7",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.4.0",
        "typescript": "^2.4.0-dev.20170512",
        "zone.js": "^0.8.5"
    },
    "devDependencies": {
        "@angular/cli": "^1.0.3",
        "@ionic/app-scripts": "^1.3.7",
        "@ionic/cli-plugin-cordova": "1.4.0",
        "@ionic/cli-plugin-ionic-angular": "1.3.1",
        "typescript": "^2.3.3"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [],
    "description": "Communities: An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-facebook4": {
                "APP_ID": "119079515323058",
                "APP_NAME": "Communities"
            },
            "cordova-plugin-geolocation": {
                "GEOLOCATION_USAGE_DESCRIPTION": " "
            },
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "ionic-plugin-deploy": {},
            "cordova-plugin-camera": {
                "CAMERA_USAGE_DESCRIPTION": " ",
                "PHOTOLIBRARY_USAGE_DESCRIPTION": " "
            }
        },
        "platforms": [
            "android"
        ]
    }
}

the line number is pointing to this method on main.js

let UserService = class UserService {
    constructor(_http) {
        this._http = _http;
        this.isUploadingImage = false;
        this._url = __WEBPACK_IMPORTED_MODULE_2__providers_base_link_base_link__["a" /* BaseLinkProvider */].GetBaseUrl() + '/User';
        this._imageUploadURL = __WEBPACK_IMPORTED_MODULE_2__providers_base_link_base_link__["a" /* BaseLinkProvider */].GetMediaURL();
        this._users = [];
        this.headers = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Headers */]({
            'Content-Type': 'application/json',
            'Accept': 'q=0.8;application/json;q=0.9'
        });
        this.options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["c" /* RequestOptions */]({ headers: this.headers });
    }

Any one any ideas?


#14

I had to create a new IONIC app and migrate my code over

i am not able to plug in a spare android and see my code on the Device by “Run”

Sujan thank you for helping me with this


#15

Great you figured it out. In hindsight it sounds like your Ionic project broke at one point, so moving over to a new project was the best - and easiest - move.