Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not find script file "C:\res\windows\zip.js" in Phonegap (windows)

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 ?

like image 501
bazinga Avatar asked Jun 29 '15 10:06

bazinga


3 Answers

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

npm update -g phonegap
like image 106
danboh Avatar answered Nov 04 '22 08:11

danboh


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
like image 1
UtopiaIsGood Avatar answered Nov 04 '22 08:11

UtopiaIsGood


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)

like image 1
gillesC Avatar answered Nov 04 '22 10:11

gillesC