1

I am new to sencha and creating a app which is coming up on browser but not device. I have followed basic steps as mentioned in tutorial : https://docs.sencha.com/touch/2.4/getting_started/building_your_first_app.html

To simulate the case, here are the steps we executed:

  • sencha -sdk generate app MyApp

  • sencha cordova init com.mycompany.MyApp MyApp

  • sencha web start (with this we are able to run in browser)

  • Updated app.json to include android:

    "builds": {
      "web": {"default": true},
        "android": {
        "packager": "cordova",
        "cordova" : {                
              "config": {       
                "platforms": "android",
                "id": "com.mycompany.MyApp",
                "name": "MyApp"
            }
        }
    }
    },
    
  • sencha app build android

  • sencha app build -run android
  • Post this we were able to open app in android studio from cordova/platforms/android
  • when we executed from studio, it is always stuck at "Apache Cordova- Device is ready " screen .. which is from the html of MyApp/cordova/platforms/android/assets/www/index.html and it is not referring to /MyApp/index.html

Its same behaviour on iOS as well!!

Are we missing out any steps here ?

Sadgati
  • 11
  • 2
  • 1
    Hm I don't like the settings in your app.json, I always used this one http://docs.sencha.com/cmd/guides/cordova_phonegap.html#cordova_phonegap_-_developing_a_cordova_app the last one in that section, so you have builds object with native object and than use `sencha app build native` cos in your example I think that you have specified build 'web' not android. Also please post the version of Sencha Cmd you are using. – pagep Nov 20 '16 at 14:19
  • Sencha cmd version is : Sencha Cmd v6.2.0.103 You are right. Its not native . The command I am using is "sencha app build -run android" . web is added by default, and for android build I have added "android" build. Its actually as per the steps mentioned in docs. – Sadgati Nov 21 '16 at 05:54

1 Answers1

0

You app.json was not structured properly. Edit your app.json to reflect below and run sencha app build.

"builds": {
    "native": {
        "default": true,
        "packager": "cordova",
        "cordova" : {                
            "config": {       
                "platforms": "android",
                "id": "com.mycompany.MyApp",
                "name": "MyApp"
            }
        }
    }
},
vahissan
  • 2,322
  • 16
  • 26