You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-instantiated variable "ANDROID_SUPPORT_VERSION" in build.gradle since version 2.1.0, causing "Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION'"
#240
before adding an android cordova platform, the variable ANDROID_SUPPORT_VERSION should be set according to the passed argument (here 26.+) in the build.gradle resp. for the platform plugin.
In the platforms/android/build.gradle there should be (as in version 2.0.19):
Our build for our cordova app fails, because of an update from cordova-plugin-file-opener2 version 2.0.19 to 2.1.0. The lower version works just fine, but 2.1.0 not.
In the build.gradle file the variable ANDROID_SUPPORT_VERSION is not instantiated with a value, when invoking
The non-instantiated variable leads to the following build error for us
15:33:38 FAILURE: Build failed with an exception.
15:33:38
15:33:38 * Where:
15:33:38 Build file '/Users/dummy/workspace/project/platforms/android/build.gradle' line: 261
15:33:38
15:33:38 * What went wrong:
15:33:38 A problem occurred evaluating root project 'android'.
15:33:38 > Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
because of the line compile "com.android.support:support-v4:$ANDROID_SUPPORT_V4_VERSION" in the build.gradle since the new version.
Reproduce Scenario
delete plugins folder and platforms folder
invoke in terminal
@Bernhard-St, thanks for raising this issue and for taking the time to add all of this detail. I think I can help you out.
Firstly, version 2.0.21 doesn't exist, there is only 2.0.19 and 2.1.0. Version 2.1.0 introduced the new variable around the android support version, but requires Cordova CLI 7 or newer (see #238). Unfortunately we were unaware of the incompatibility with Cordova CLI 6, otherwise we would have done a major release instead.
Secondly, your issue has helped to identify a typo in the README, as the name of the variable in the example was wrong. It should be ANDROID_SUPPORT_V4_VERSION not ANDROID_SUPPORT_VERSION . I will be releasing a patch release to fix this for both github and npm today.
Anyway, a couple of suggested ways to fix the issue.
If you can upgrade to Cordova CLI 7 or newer then you can do that and install version 2.1.0 of the plugin.
If you can't upgrade your Cordova CLI then stick to version 2.0.19 of the plugin, which does not have the variable, but the cordova-android-support-gradle-release should help keep the support versions consistent for your project.
@shnist, Thank you for your response to my reported issue and your support.
As you pointed out, I incorrectly stated the wrong version. I changed the version in my issue description, accordingly.
Unfortunately, I cannot upgrade at the moment, so I will stick to Cordova CLI 6.5.0 and version 2.0.19 of the cordova-plugin-file-opener2 plugin.
Bernhard-Steindl
changed the title
Non-instantiated variable "ANDROID_SUPPORT_VERSION" in build.gradle since version 2.0.21, causing "Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION'"
Non-instantiated variable "ANDROID_SUPPORT_VERSION" in build.gradle since version 2.1.0, causing "Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION'"
Jan 7, 2019
Expected Behaviour
When invoking the following command
before adding an android cordova platform, the variable
ANDROID_SUPPORT_VERSION
should be set according to the passed argument (here26.+
) in thebuild.gradle
resp. for the platform plugin.In the
platforms/android/build.gradle
there should be (as in version2.0.19
):instead of a non-instantiated variable
ANDROID_SUPPORT_V4_VERSION
The
plugins/cordova-plugin-file-opener2/plugin.xml
has changed between these versions as follows.Since version
2.1.0
in version
2.0.19
Actual Behaviour
Our build for our cordova app fails, because of an update from
cordova-plugin-file-opener2
version2.0.19
to2.1.0
. The lower version works just fine, but2.1.0
not.In the
build.gradle
file the variableANDROID_SUPPORT_VERSION
is not instantiated with a value, when invokingThe non-instantiated variable leads to the following build error for us
because of the line
compile "com.android.support:support-v4:$ANDROID_SUPPORT_V4_VERSION"
in thebuild.gradle
since the new version.Reproduce Scenario
delete
plugins
folder andplatforms
folderinvoke in terminal
and then
Check
platforms/android/build.gradle
under dependency for an non-instantiated variableANDROID_SUPPORT_VERSION
.Our config.xml contains:
Platform and Version
Plugin version
cordova-plugin-file-opener2 2.1.0 "File Opener2"
Update:
Corrected Typo of plugin version from
2.0.21
to2.1.0
.The text was updated successfully, but these errors were encountered: