pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

missing cordova.js #326

Open smkamranqadri opened 6 years ago

smkamranqadri commented 6 years ago

I am working on an old project built with manifold for iOS, now working to build android app.

I have added the platform and also added android in manifest under mjs_api_access but still the cordova file is not injecting.

Help in this regard is much appreciated.

mbellezi commented 5 years ago

I'n having the same problem. The _cordovaNative is present but not cordova. How can it be injected?

mbellezi commented 5 years ago

my mjs_api_access:

"mjs_api_access": [
    {
        "match": "*",
        "access": "cordova",
        "platform": "ios,windows,android"
    }
],
"mjs_cordova": {
    "plugin_mode": "client"
},
smkamranqadri commented 5 years ago

Don't know, my problem still exist, maintainer please help us.

boyofgreen commented 5 years ago

hi folks, this is for android correct? have you reviewed the old docs:

https://github.com/pwa-builder/PWABuilder-CLI/wiki/Using-Cordova-Plugins-in-Hosted-Web-Apps you may need to set the cordova.js to be injected automatically, we had it set so that you could add it to your website, or have the tool auto inject it at page load.

mbellezi commented 5 years ago

Yes, Android. Aren't the mjs_api_access and mjs_cordova directives enough to get cordova.js automatically injected at page load?

boyofgreen commented 5 years ago

so make sure you are have clien mode set: https://github.com/pwa-builder/PWABuilder-CLI/wiki/Using-Cordova-Plugins-in-Hosted-Web-Apps { ... "mjs_cordova": { "plugin_mode": "client" } }

mbellezi commented 5 years ago

Yes, it is set. using plugin_mode.

f2bo commented 5 years ago

Have you tried with a different value for the match attribute in the mjs_api_access rule instead of '*'? I'm not sure that using a wildcard for the entire URL is supported. Try a more complete URL like https://github.com/* to see if that works.

mbellezi commented 5 years ago

Yes, first I've tried the URL like https://github.com/ . I've changed to after that.

756gzdz5 commented 5 years ago

Did you update cordova ios? It seems like newer version don't work.

boyofgreen commented 5 years ago

we did update but I don't think it has made it to public builds yet. @nbellocam right? Our update should get iOS working again. We are pushing it through the system this week

756gzdz5 commented 5 years ago

@boyofgreen are you still planning on doing the update this week?

756gzdz5 commented 5 years ago

I just realized that you updated the IOS version in the meantime. After downloading the project, I added the following lines to the manifest and built the cordova project.

"mjs_extended_scope": [
        "*"
    ],
    "mjs_api_access": [
        {
            "match": "https://domain.com/*",
            "platform": "android,ios",
            "access": "cordova"
        }
    ]

Then, I ran it on an Iphone using Xcode and couldn't find the cordova.js. Is still supposed to work?

Those settings worked before, as long as I didn't update the cordova-ios-version that came with it.

SamLoy commented 5 years ago

I have been struggling with the same issue.

After playing with various combinations and following the various Wikis, the only time i've seen cordova.js served from the App's local files itself when the default index.html file is used instead of my webapp's index.html.

To load the default Cordova screen I removed the reference in config.xml which was pointing to my site: <content src="https://mywebsite.com"/>

The default index.html file references the cordova.js file, which is resolved to file:///android_assets/www/cordova.js image

If I add <content src="https://mywebsite.com"/> back into config.xml so my site's index.html file is used, the same link ` Githubissues.

  • Githubissues is a development platform for aggregating issues.