Created
April 2, 2018 14:40
-
-
Save joeljeske/68121fa6d643e0937f50458d0172e16e to your computer and use it in GitHub Desktop.
Fixes android plugin install that fail because it cannot find AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This hook overrides a function check at runtime. Currently, cordova-android 7+ incorrectly detects that we are using | |
* an eclipse style project. This causes a lot of plugins to fail at install time due to paths actually being setup | |
* for an Android Studio project. Some plugins choose to install things into 'platforms/android/libs' which makes | |
* this original function assume it is an ecplise project. | |
*/ | |
module.exports = function(context) { | |
if (context.opts.cordova.platforms.indexOf('android') < 0) { | |
return; | |
} | |
const path = context.requireCordovaModule('path'); | |
const androidStudioPath = path.join(context.opts.projectRoot, 'platforms/android/cordova/lib/AndroidStudio'); | |
const androidStudio = context.requireCordovaModule(androidStudioPath); | |
androidStudio.isAndroidStudioProject = function() { return true; }; | |
}; |
worked for me on [email protected], cheers!
FYsI: updating to Android 8.0.0, from 7.1.4, meant I had to remove this script as it was causing build errors.
I'm upgrading to 8.0.1 and still running into the same issue, unfortunately . Does anyone have any idea ?
Error: ENOENT: no such file or directory, open './platforms/android/AndroidManifest.xml'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I finally made it work but I gad to downgrade the android platform version to 6.3.0