15

Thought of trying phonegap today.

  • Installed Node.js

  • installed phonegap using command:

     npm install -g phonegap
    
  • created app using

    phonegap create my-app
    
  • running command

    phonegap run android 
    
  • got this error - Can not find script file "C:\res\windows\zip.js"

Not sure what's happening. I have tried downloading zip.js and placing inside www\js as well as build. Not sure why the error is referring to res folder while there isn't any.

Anyone faced similar situation ?

bazinga
  • 983
  • 6
  • 9
  • Facing the same issues here. Trying phonegap for the first time and really not making much progress due to this error – danboh Jul 07 '15 at 01:54
  • I'm getting the same error when running phonegap run ios, do you too? – danboh Jul 08 '15 at 00:17

3 Answers3

5

I was able to get rid of the error by updating Phonegap:

npm update -g phonegap
danboh
  • 758
  • 2
  • 11
  • 28
1

You can see Github issue with the same probmlem -> https://github.com/phonegap/phonegap-cli/issues/81

or here -> https://github.com/phonegap/phonegap-cli/issues/77

You should go to the app directory:

$ cd my-app/
$ phonegap build android
UtopiaIsGood
  • 169
  • 3
  • 15
  • 1
    I'm running the command from the 'my-app' dir, yet it still displays the error that it can't find the js file. In my case, it is trying to look in my C:\Users\MyUser\res\windows directory. This seems to be the parent from where I run the command – SupremeDud Jul 07 '15 at 18:14
1

I had the same problem, and found a solution!

Solution:

  • Insure you've installed the Java JDK and Android SDK (I installed the Android SDK through Android Studio)

  • Install Cordova (core of PhoneGap). Because I'm not sure if you can run the cordova commands without installign cordova seperatly.

  • Now the reason why your commands weren't working: after phonegap create my-app, the PhoneGap CLI doesn't create a folder for the Android platform. Thus when running the command: phonegap run android, the android platform is'nt present in the PhoneGap project. To solve this issue just run the following command: cordova platform add android (in the my-app folder)
  • Then build: phonegap local build android, and the Android app will successfully compiled.

Easier alternatives:

  • PhoneGap Build: It is a cloud-based service who removes the need for different SDKs to build the application for different platforms. It is a free service as long that your applications are open-source, or you limit your private apps to just one.

  • Develop the application with your beloved edittor/IDE and run the application with the Desktop app, who runs a local server connecting with the application which you can download at the application stores.

  • Just Build/run the application in the platforms' IDE. In case of Android, use Android studio to build en deploy the application on your device. (Open the platforms->Android project in your IDE)

gillesC
  • 677
  • 1
  • 5
  • 23