Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap cordova.js is missing

I use my connected phone as an ADB device.

→ phonegap -v 3.1.0-0.15.0

I have almost nothing in my index.html

    <script type="text/javascript" src="phonegap.js"></script>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/angular.min.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
</body>

When i run

→ phonegap local run android  
[phonegap] compiling Android...
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
[phonegap] successfully installed onto device

I can see my app runing and before did not notice the error in console. Then i tried more complicated things like ngRoute but it did not work. I decided to remove all data to almost empty project as you can see(to be sure something else does not cause this error).

Then i checked the console via:

adb logcat | grep -i console

And i see:

I/Web Console( 3946): Could not find cordova.js script tag. Plugin loading may 

fail.:1511
E/Web Console( 3946): Uncaught module cordova/plugin_list already defined:76
I/Web Console( 4329): exception firing pause event from native:1
I/Web Console( 4329): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 4329): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 5006): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 5006): Uncaught module cordova/plugin_list already defined:76
I/Web Console( 5476): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 5949): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 5949): Uncaught module cordova/plugin_list already defined:76
I/Web Console( 6374): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 6374): Uncaught module cordova/plugin_list already defined:76
I/Web Console( 6762): exception firing pause event from native:1
I/Web Console( 6762): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 7141): exception firing pause event from native:1
I/Web Console( 7141): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 7141): Uncaught module cordova/plugin_list already defined:76
I/Web Console( 7267): exception firing pause event from native:1
I/Web Console( 7267): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 7383): exception firing pause event from native:1
I/Web Console( 7383): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 7557): exception firing pause event from native:1
I/Web Console( 7557): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 7697): exception firing pause event from native:1
I/Web Console( 7697): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 7998): exception firing pause event from native:1
I/Web Console( 7998): Could not find cordova.js script tag. Plugin loading may fail.:1511
I/Web Console( 8156): exception firing pause event from native:1
I/Web Console( 8156): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 8156): Uncaught ReferenceError: angular is not defined:10
I/Web Console( 8491): exception firing pause event from native:1
I/Web Console( 8491): Could not find cordova.js script tag. Plugin loading may fail.:1511
E/Web Console( 8491): Uncaught module cordova/plugin_list already defined:76

But it does not makes sence. I have this script tag in my index.html as you can see + this file exists in:

platforms/android/assets/www/

I also copied this file into my normal www directory.

So what's the problem please?

like image 304
Lukas Lukac Avatar asked Nov 19 '13 16:11

Lukas Lukac


3 Answers

Try to remove the line:

<script type="text/javascript" src="phonegap.js"></script>

from your index.html. If you take a closer look you will see that phonegap.js and cordova.js are the same size. Apparently phonegap.js exists for legacy support reasons, but you should use only cordova.js.

This is what it's actually suggested in the GitHub Issue referenced in the comments, and it did the trick for me, I stopped getting the Could not find cordova.js script tag message.

like image 102
AntonioHerraizS Avatar answered Oct 08 '22 06:10

AntonioHerraizS


I replaced the phonegap.js with cordova.js and it worked, as referenced here: https://github.com/phonegap/phonegap-cli/issues/134#issuecomment-22035314

Remove from index.html:

<script type="text/javascript" src="phonegap.js"></script>

and add:

<script type="text/javascript" src="cordova.js"></script>
like image 37
AmpT Avatar answered Oct 08 '22 05:10

AmpT


I have resolved this issue by completely reinstall of everything and setting up enviroment back again but now BY CORDOVA TERMINAL COMMANDS not phonegap.

like image 36
Lukas Lukac Avatar answered Oct 08 '22 07:10

Lukas Lukac