Fresh install; directory structure doesn't seem right, and running default app creates errors :(


#1

OSX 10.9.2.

I have all prerequisites installed. I’m following the installation section of the Guide.

Matts-MacBook-Pro:Projects matt$ ionic start myTest blank
Running start task...
Creating Ionic app in folder /Users/matt/Projects/myTest based on blank project

DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip

So far, so good.

Matts-MacBook-Pro:Projects matt$ ls myTest
ionic-app-base-master	ionic.project

Hmm, odd. I expected to see www, js, etc.

Matts-MacBook-Pro:Projects matt$ cd myTest
Matts-MacBook-Pro:myTest matt$ ionic platform android
Running platform task...
Adding platform android
Current working directory is not a Cordova-based project.
Unable to add platform android. Please see console for more info.

Bleh.

Matts-MacBook-Pro:myTest matt$ cd ionic-app-base-master/ && ionic platform android
Running platform task...
Adding platform android
Creating android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.ionicframework.starter
	Name: HelloCordova
	Android target: android-19
Copying template files...
Running: android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"
Resolved location of library project to: /Users/matt/Projects/myTest/ionic-app-base-master/platforms/android/CordovaLib
Updated and renamed default.properties to project.properties
Updated local.properties
No project name specified, using Activity name 'HelloCordova'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/build.xml
Added file platforms/android/proguard-project.txt
Updated project.properties
Updated local.properties
No project name specified, using project folder name 'CordovaLib'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/CordovaLib/build.xml
Added file platforms/android/CordovaLib/proguard-project.txt

Project successfully created.

Score!

Matts-MacBook-Pro:ionic-app-base-master matt$ ionic emulate android
Running emulate task...

… and all the output that comes from firing up the emulator and compiling in cordova.
The app loads in the emulator, but if I inspect it using the Chrome inspector I see three errors:

Failed to load resource file:///android_asset/www/css/style.css
Failed to load resource file:///android_asset/www/lib/ionic/js/ionic.bundle.js
Uncaught ReferenceError: angular is not defined app.js:6

So, am I missing something? I’m not sure if I’m off base here because of the fact that the guide may be outdated, or should I not even believe the inspector? I have noticed that if I create an angular controller, and set a test variable (e.g. $scope.mytest = “foo”), it will not render in the view. I suspect that this is because the JS isn’t executing due to the errors referenced in the inspector. Does anyone know what’s going on here?

tl;dr: Creating new project from scratch using the beta, default project throws errors in Chrome inspector when run on Android emulator.

Any help would be greatly appreciated.


Fresh install, implementing tutorial app, failing to serve stylesheets
#2

As a follow-up to anyone who may have read this:

The command

ionic start myTest blank

… doesn’t actually copy the necessary js files into your project’s source tree. I copied them manually from the .zip file and everything works now. Just wanted to save anyone else a headache. It would seem that the “start” task should create those files appropriately, no?


#3

You mind trying this again? I just ran the same process and everything looks fine.

-rw-r--r--   1 jn  staff    14 Apr 10 09:32 .gitignore
-rw-r--r--   1 jn  staff  2024 Apr 10 09:32 README.md
-rw-r--r--   1 jn  staff   810 Apr 10 09:32 config.xml
-rw-r--r--   1 jn  staff   620 Apr 10 09:32 gulpfile.js
drwxr-xr-x   4 jn  staff   136 Apr 10 09:32 hooks
-rw-r--r--   1 jn  staff    75 Apr 10 09:32 ionic.project
drwxr-xr-x   3 jn  staff   102 Apr 10 09:32 merges
-rw-r--r--   1 jn  staff   253 Apr 10 09:32 package.json
drwxr-xr-x   4 jn  staff   136 Apr 10 09:32 platforms
drwxr-xr-x   7 jn  staff   238 Apr 10 09:32 plugins
drwxr-xr-x   3 jn  staff   102 Apr 10 09:32 scss
drwxr-xr-x  11 jn  staff   374 Apr 10 09:32 www

#4

Here’s the output of the “tree” command:

.
├── ionic-app-base-master
│   ├── README.md
│   ├── config.xml
│   ├── gulpfile.js
│   ├── hooks
│   │   └── README.md
│   ├── package.json
│   ├── platforms
│   ├── plugins
│   ├── scss
│   │   └── ionic.app.scss
│   └── www
│       ├── index.html
│       ├── js
│       │   └── app.js
│       └── lib
│           └── ionic
│               ├── css
│               │   ├── ionic.css
│               │   └── ionic.min.css
│               └── fonts
│                   ├── ionicons.eot
│                   └── ionicons.svg
└── ionic.project

The problem is that it didn’t include ionic.bundle.js, etc in www/lib/ionic/js. Is this only an osx thing?


#5

I’m running Mac OS 10.9.2 - just like you it seems.

Perhaps you have an old version of Ionic CLI?

This WHOLE process works for me locally:

  • npm install -g cordova ionic /// This will get you to the newest release.

  • ionic start myTest blank


#6

I ran:

 npm install -g cordova ionic   

…and verified that I have ionic@1.0.1-beta.

Then:

$ ionic start myTest blank
Running start task...
Creating Ionic app in folder /Users/matt/Projects/myTest based on blank project
        
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
$ cd myTest
$ tree
.
├── ionic-app-base-master
│   ├── README.md
│   ├── config.xml
│   ├── gulpfile.js
│   ├── hooks
│   │   └── README.md
│   ├── package.json
│   ├── platforms
│   ├── plugins
│   ├── scss
│   │   └── ionic.app.scss
│   └── www
│       ├── index.html
│       ├── js
│       │   └── app.js
│       └── lib
│           └── ionic
│               ├── css
│               │   ├── ionic.css
│               │   └── ionic.min.css
│               └── fonts
│                   ├── ionicons.eot
│                   └── ionicons.svg
└── ionic.project

I realized that it’s silly to think it’s a platform issue. The only other possibility I can think of is that https://github.com/driftyco/ionic-app-base/archive/master.zip is being cached locally, perhaps?


#7

I’ve had the same result as baggachipz (except that I’m using Ubuntu 12.04 LTS), so would like to add a +1 here, if anyone knows of a proper fix. Thanks.


#8

news? I’ve the same problem in ubuntu 14.04


#9

I resolved using node v0.10.28