No such file or directory properties.gradle
Closed this issue · 4 comments
I'm submitting a ... (check one with "x"):
- bug report
- feature request
- documentation issue
Bug report
Current behavior:
cordova-android-support-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open '/home/benni/htdocs/redacted/platforms/android/app/cordova-android-support-gradle-release/properties.gradle'
Expected behavior:
The plugin should work
Steps to reproduce:
cordova plugin add cordova-android-support-gradle-release
Environment information
- Cordova CLI version
8.0.0
- Cordova platform version
Installed platforms: android 7.2.0-dev
- Plugins & versions installed in project (including this plugin)
com.synconset.cordovaHTTP 1.3.0 "SSL Pinning" com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions" cordova-android-support-gradle-release 1.4.4 "cordova-android-support-gradle-release" cordova-plugin-apprate 1.3.0 "AppRate" cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine" cordova-plugin-device 1.1.2 "Device" cordova-plugin-dialogs 1.2.1 "Notification" cordova-plugin-facebook4 2.1.0 "Facebook Connect" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-transfer 1.7.2-dev "File Transfer" cordova-plugin-geolocation 4.0.1 "Geolocation" cordova-plugin-globalization 1.0.3 "Globalization" cordova-plugin-inappbrowser 1.4.0 "InAppBrowser" cordova-plugin-localization-strings 2.0.0 "Localization" cordova-plugin-network-information 1.2.1 "Network Information" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-statusbar 2.1.3 "StatusBar" cordova-plugin-whitelist 1.2.2 "Whitelist" cordova-plugin-zip 3.1.0 "cordova-plugin-zip" cordova-sqlite-storage 2.3.2 "Cordova sqlite storage plugin" cordova-support-google-services 1.1.0 "cordova-support-google-services" ionic-plugin-keyboard 2.2.1 "Keyboard" phonegap-plugin-multidex 1.0.0 "Multidex" phonegap-plugin-push 2.2.3 "PushPlugin"
- Dev machine OS and version, e.g.
- Linux
- Linux benjamin-pc 4.17.2-1-ARCH #1 SMP PREEMPT Sat Jun 16 11:08:59 UTC 2018 x86_64 GNU/Linux
This looks to be a regression bug in cordova-android@7.2.0-dev
as I can repro the issue with cordova-android@7.2.0-dev
but it works fine with the latest release (cordova-android@7.1.0
) - see console output below.
This plugin relies on Cordova to deploy the properties.gradle file via a <source-file>
entry in the plugin.xml
.
cordova-android@7.2.0-dev
has not deployed the gradle file to the expected location when the plugin was installed, so when the apply-changes script attempts to overwrite the file contents of properties.gradle
, it's not present so throws an exception.
I'd advise raising a JIRA ticket in the Cordova issue tracker and using cordova-android@7.1.0
in the meantime.
console output
$ cordova create test
Creating a new cordova project.
$ cd test
$ cordova platform add https://github.com/apache/cordova-android
Using cordova-fetch for https://github.com/apache/cordova-android
Warning: using prerelease platform android@7.2.0-dev.
Use 'cordova platform add android@latest' to add the latest published version instead.
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-27
Android project created with cordova-android@7.2.0-dev
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous
platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@https://github.com/apache/cordova-android into config.xml file ...
$ cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=26.+
Installing "cordova-android-support-gradle-release" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: No custom version found in config.xml - using plugin default
Adding cordova-android-support-gradle-release to package.json
Saved plugin info for "cordova-android-support-gradle-release" to config.xml
$ cordova prepare android
Android Studio project detected
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-support-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open 'D:\Temp\test\platforms\android\app\cordova-android-support-gradle-release\properties.gradle'
$ cordova platform rm android
Removing platform android from config.xml file...
Removing android from cordova.platforms array in package.json
$ cordova plugin rm cordova plugin add cordova-android-support-gradle-release
Removing "cordova-android-support-gradle-release"
Removing plugin cordova-android-support-gradle-release from config.xml file...
Removing cordova-android-support-gradle-release from package.json
$ cordova platform add android@latest
Using cordova-fetch for cordova-android@latest
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-27
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.1.0
Android Studio project detected
Android Studio project detected
Installing "cordova-android-support-gradle-release" for android
Subproject Path: CordovaLib
Subproject Path: app
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\cordova-android-support-gradle-release\properties.gradle
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous
platform version, you do *not* need this plugin since the whitelist will be built in.
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\cordova-android-support-gradle-release\properties.gradle
--save flag or autosave detected
Saving android@latest into config.xml file ...
$ cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=26.+
Installing "cordova-android-support-gradle-release" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: No custom version found in config.xml - using plugin default
Adding cordova-android-support-gradle-release to package.json
Saved plugin info for "cordova-android-support-gradle-release" to config.xml
$ cordova prepare android
Android Studio project detected
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '26.+' to D:\Temp\test\platforms\android\app\cordova-android-support-gradle-release\properties.gradle
FYI: Encountered the same error with new cordova-android@7.1.2
release.
I'm having a go at fixing this for my app (still experimenting):
1.4.5...ippeiukai:v1.4.5-patched_for_cordova_android_7
i just removed the plugin to make the problem go away ..
cordova.cmd platform update android@6.2.1
Using cordova-fetch for cordova-android@6.2.1
Updating android project...
Subproject Path: CordovaLib
Android project updated with cordova-android@6.2.1
cordova-android-play-services-gradle-release: overriding com.google.android.gms:play-services-tagmanager:+ in build.gradle with com.google.android.gms:play-services-tagmanager:17.0.0
Error: ENOENT: no such file or directory, scandir './platforms/android/cordova-android-play-services-gradle-release'
at Object.readdirSync (fs.js:785:3)
at processPackages (C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\plugins\cordova-android-play-services-gradle-release\scripts\apply-changes.js:164:103)
at _fulfilled (C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:854:54)
at C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:883:30
at Promise.promise.promiseDispatch (C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:816:13)
at C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:570:49
at runSingle (C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:137:13)
at flush (C:\Users\Gabriel\Documents\GabFile\MyProject\FPImobile\node_modules\q\q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:61:11)
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd platform update android@6.2.1 exited with exit code 1.
Re-running this command with the --verbose flag may provide more information
Any help?? what have i done wrong??