Open algorist-mechanism opened 6 years ago
Hi, @algorist-mechanism . Thank you for the issue and for your contribution.
For the moment, we plan to keep this plugin compatible with cordova 7 . It seems that making it compatible with cordova 8 would break cordova 7 compatiblity.
We'll leave this issue open for linking to your PR that brings compatibility with cordova 8: https://github.com/janeasystems/nodejs-mobile-cordova/pull/4
@jaimecbernardo This is only applicable for a fresh install of cordova 8.0.0 using the android platform. You won't see this problem if you are upgrading from an earlier version or using just ios.
Here's a workaround for those using a fresh install of cordova 8.0.0. TLDR; Use cordova-android version 6.4. (or whatever the most current 6.x before 7.0 is)
cordova create MyApp
cd MyApp
cordova platform add android@6
cordova plugin add nodejs-mobile-cordova
Longer version:
Note: cordova means the package installed with npm install cordova
. The versions of interest are cordova 8.0.0 and 7.1.0. cordova-android is the package installed with cordova platform add android
. The versions of interest are 7.0.0 (default for cordova 8.0) and 6.x (default for cordova 7.1.0).
cordova 8.0.0 pins the default android platform as cordova-android 7.0.0. Here's how we know, from running the following after a fresh install.
cordova platform ls
Installed platforms:
Available platforms:
android ~7.0.0
browser ~5.0.1
ios ~4.5.4
osx ~4.0.1
windows ~5.0.0
www ^3.12.0
cordova-android 7.0.0 uses and creates the new Android Studio directory structure as a default. That new structure breaks the nodejs-mobile-cordova plugin since files aren't where they expect them to be.
https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/Api.js#L82-L93 for those curious to what some of the changes are.
We want to use the "legacy" Eclipse directory structure. cordova-android 6.4.0 creates and uses it. So instead of using the default cordova-android that cordova 8 uses, we instead use
cordova platform add android@6
and can successfully proceed with
cordova plugin add nodejs-mobile-cordova
The good news, once you have the Eclipse directory structure in use, cordova won't switch you to the new Android Studio directory structure. It only does that for new installations.
Hi @algorist-mechanism , Thank you for the workaround!
I'm using the workaround, I'm using Cordova 8.0.0, and I have the Android NDK installed. Is the nodejs
variable supposed to be a global variable accessible through the window
object? I'm not seeing it.
Hi @lastmjs ,
No not through the window
object. Sample code would be a place to start: https://github.com/janeasystems/nodejs-mobile-cordova#usage
I am seeing this problem with ios. I am not using android. Here is my stack: Installed platforms: ios 4.5.5 Available platforms: browser ~5.0.1 osx ~4.0.1 windows ~6.0.0
The following build commands failed: Ld /Users/mc/Library/Developer/Xcode/DerivedData/hdapp2-afrozyqeoetarqbiqdxpuqmwuxru/Build/Intermediates.noindex/ArchiveIntermediates/hdapp2/IntermediateBuildFilesPath/hdapp2.build/Debug-iphoneos/hdapp2.build/Objects-normal/armv7/hdapp2 normal armv7 (1 failure)
Any resolution please?
Hi @jollysean,
This shouldnt' be a problem if the instructions to set the Deployment Target to 11.0 have been followed, since 11.0 wouldn't support armv7 CPUs. Is this helpful?
Any solution on this?
Hi @tim-coin , Have you tried the workaround suggested in an earlier comment? https://github.com/janeasystems/nodejs-mobile/issues/48#issuecomment-366858320
Hi @jaimecbernardo
We need the new structure of cordova 8 in our app.
Hi @tim-coin , unfortunately, Cordova 8 structure is not supported yet, since we want to support Cordova 7 still and there are some incompatibilities. If you get it working, please consider leaving some comments on what you've changed for other users who might need it.
i have the same problem i try all the above solution but not worked
Steps to repeat:
Expected behavior:
cordova plugin add nodejs-mobile-cordova --verbose
should install successfully. See log below for failed install.