Closed Bernhard-Steindl closed 5 years ago
@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 https://github.com/pwlin/cordova-plugin-file-opener2/issues/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.
Let me know how you get on.
@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.
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
folder invoke in terminaland 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
.