Closed l0stpenguin closed 4 years ago
Untested, but should be something like:
<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
<uses-sdk android:minSdkVersion="21" />
</edit-config>
Also note that, I think that way of defining minSdkVersion
is deprecated, I think you're suppose to define it via gradle instead, but not 100% sure on that detail.
@breautek I tried your solution but the build failed with an error:
unable to graft /manifest/uses-sdk from xml
So i changed the value via a custom gradle reference by using the following gradle file and it worked:
def minSdkVersion = 21
if(cdvMinSdkVersion == null) {
ext.cdvMinSdkVersion = minSdkVersion;
} else if (cdvMinSdkVersion.toInteger() < minSdkVersion) {
ext.cdvMinSdkVersion = minSdkVersion;
}
And my main plugin.xml:
<platform name="android">
<framework src="test.gradle" custom="true" type="gradleReference"/>
</platform>
Adding to the test plugin.xml did not seem to work, so had to add directly in the main plugin.
Feature Request
I am currently implementing testing for my plugin cordova-plugin-background-upload using cordova paramedic on Travis. But it lacks the ability to customise the generated project, more specifically overriding the
minSdk
version for android.Motivation Behind Feature
The plugin depends on a native android library (android-upload-service) which i am upgrading. the issue is that the library needs a minimum android sdk version of 21 but the generated cordova project hardcodes it to 19. This is usually solved by setting
android-minSdkVersion
in the projectconfig.xml
:<preference name="android-minSdkVersion" value="21" />
Since i do not have access to the generated cordova project, i can't set it as required. Hence the build fails completely:Complete log of the build can be accessed here: https://travis-ci.org/spoonconsulting/cordova-plugin-background-upload/jobs/633747584
Feature Description
Having a config parameter like
cordova-config-path
pointing to the location of a normal cordova config.xml would be helpful. This would be merged with the generated one and hence allowing customisation.Alternatives or Workarounds
I currently have not found any workaround to fix this issue. Is there something i can do to allow the plugin to be built?