-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Quick fix for inconsistent SDK versions #633
[WIP] Quick fix for inconsistent SDK versions #633
Conversation
314b4ef
to
a45b329
Compare
a45b329
to
c386f2d
Compare
Updated as follows:
|
@brodybits Can you take a look into the AppVeyor build failure? |
Codecov Report
@@ Coverage Diff @@
## master #633 +/- ##
==========================================
- Coverage 64.66% 64.46% -0.21%
==========================================
Files 18 18
Lines 1817 1829 +12
==========================================
+ Hits 1175 1179 +4
- Misses 642 650 +8
Continue to review full report at Codecov.
|
Now green after an empty commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall
LGTM
Recommendation:
If this is considered the final fix and you are not expecting to revisit, please remove the comments Quick fix
from the files.
If you are planning additional work, can you replace the comments with
// @todo What is the desired task to preform other than the word quick fix. This is so if you are unable to revisit the area and others or I have time, we might be able to help out in this area as we would be able to understand what was the desired/expected task.
The above recommendations are just my opinions.
My Test Steps
$ npx cordova@nightly create androidTest com.foobar.androidTest && cd androidTest
$ npx cordova@nightly platform add github:brodybits/cordova-android\#quick-fix-for-inconsistent-sdk-versions
$ npx cordova@nightly build android
======================
build.gradle RESULTS
======================
defaultBuildToolsVersion="28.0.3"
defaultMinSdkVersion=19
defaultTargetSdkVersion=27
defaultCompileSdkVersion=27
$ vi config.xml
// ADDED
<preference name="android-minSdkVersion" value="21" />
<preference name="android-targetSdkVersion" value="28" />
$ npx cordova@nightly build android
======================
build.gradle RESULTS
======================
defaultBuildToolsVersion="28.0.3"
defaultMinSdkVersion=21
defaultTargetSdkVersion=28
defaultCompileSdkVersion=28
Thanks @erisu for the review. I would consider this to be a stopgap or makeshift solution since it does not solve #508 and #631 the best way possible. I would much rather find a way to resolve #508 and #631 without injecting the minimum & default SDK values into An additional problem was already reported in #629: if we inject these SDK values in There was discussion in #508 about using In case we do continue with this PR, I would definitely favor adding the The motivation for this stopgap solution was to solve the problem without blocking the new release for Cordova 9. I just marked this proposal as [WIP] again, pending discussion whether to continue or find a better way to solve the problem. |
Closing in favor of alternatives discussed in #508 (comment) and #508 (comment) |
Resolves #508 - Inconsistent handling of min/target SDK values
This is a quick fix to use the minimum & target SDK version values from AndroidManifest.xml.
I have tested it in a newly generated Cordova project from the command line.
This proposal also resolves #631 - Target SDK version not consistent with defaults in root build.gradle bug
TODO items:update unit tests to succeed with the new code changeupdate unit tests to cover extracting minimum & target SDK version values from AndroidManifest.xmlUnfortunately this does NOT resolve the issue reported in #629 (errors encountered on Android Studio 3.2 & 3.3).
I really hope this kind of a solution will be part of the upcoming major release for Cordova 9 (apache/cordova#10).