Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

cordova-android asset path changed from 6 to 7 #1380

Closed
imhoffd opened this issue Feb 2, 2018 · 12 comments
Closed

cordova-android asset path changed from 6 to 7 #1380

imhoffd opened this issue Feb 2, 2018 · 12 comments
Labels

Comments

@imhoffd
Copy link
Contributor

imhoffd commented Feb 2, 2018

Source issues/comments:

This path is not accurate for cordova-android 7: https://github.com/ionic-team/ionic-app-scripts/blob/master/src/dev-server/serve-config.ts#L26

The path changed and we likely need to support both:

platforms/android/assets/www (cordova-android <7)
platforms/android/app/src/main/assets/www (cordova-android 7).

@imhoffd
Copy link
Contributor Author

imhoffd commented Feb 2, 2018

Update: Ionic does not officially support Cordova 8. Please use 7 (npm i -g cordova@7).

Cordova 7 will add cordova-android 6, which means the app-scripts livereload asset path in serve-config.ts is still accurate.

If you want things to work with cordova-android 7, please see this solution: #467 (comment)

@Ugur22
Copy link

Ugur22 commented Feb 13, 2018

I installed cordova 7 but I'm still getting the same error. Everytime I run the Ionic app on my Android phone it says "Cordova not available".

@filippodicostanzo
Copy link

filippodicostanzo commented Feb 15, 2018

I have the same issue.
I resolve with this fix #467
so waiting for an official update from ionic

@maxpaj
Copy link

maxpaj commented Feb 25, 2018

Is this being merged and published? It's quite a big issue...

@ivanosire
Copy link

Same problem for me ("Cordova not available") using Ionic CLI 3.19.1, cordova CLI 8.0.0 and cordova-android 7.0.0.

This Fix by @BritoMatheus resolve it for now...

@vjanssens
Copy link

Any update on this issue? Developing on Android is nearly impossible, as native plugins will not work without cordova.js.

@ZaLiTHkA
Copy link

@vjanssens, the other day I created a simple node script in my current project to manually change the relevant file path.. basically, this just "automates" the temporary workaround that @ivanosire referenced above. maybe that would help you a bit in the meantime?

@ivanosire
Copy link

This is a temporary fix.
But look well that Ionic has officialy published this note. The latest version of the cordova-android platform (7.0.0) is not yet supported by Ionic so for now it's better to use 6.4.0 version

@ZaLiTHkA
Copy link

it's a pity that Zach doesn't provide any links to more information on that that note... but it does state that it "is not yet supported by Ionic Pro's Package service.", not that an Ionic project can't use it. :) all my local builds are working fine on my test devices.

@jwburnside
Copy link

I'm having the same issue as described in many posts, and I'm about out of idea about how to fix it. Here's some info if anyone can help me out:

Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x

I'm submitting a ... (check one with "x")
[x] bug report

Current behavior:

Cordova plugins are not loaded when I run the app on a android device with the --livereload OR with the --console flags. Both rely on the livereload server.

Expected behavior:

It should load the cordova plugins whenever the app is run on a device. I am not having an issue with iOs using the same flags.

  • I have tried a couple different versions of the android platform (6.3.0, 6.4.0). I'm aware that "The latest version of the cordova-android platform (7.0.0) is not yet supported by Ionic so for now it's better to use 6.4.0 version".
  • I have edited the serve-config.js file as described in several fixes:
    exports.ANDROID_PLATFORM_PATH = path.join('platforms', 'android', 'app', 'src', 'main', 'assets', 'www');
  • This only seems to affect the android platform, iOs will log and livereload as expected.

Steps to reproduce:

Related code:

insert any relevant code here
Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.4.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v6.10.0
npm : 2.15.12
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b

Environment Variables:
ANDROID_HOME : /Users/j/Library/Android/sdk
Misc:
backend : pro

@sachingarg05
Copy link

When is Ionic likely to support Cordova 8 / cordova-android 7+ ?

Is there some reason to not support cordova8 for now, like it will break compatibility with cordova7? Or, is this related to Ionic4 and the new CLI with Ionic4 support will get the support for new cordova8/cordova-android7 also?

@imhoffd
Copy link
Contributor Author

imhoffd commented Apr 18, 2018

Hey folks, I just released 3.1.9 with a fix for this from @itslenny 🎉 Everybody thank him! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants