-
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
<preference name="android-targetSdkVersion" value="30" /> not working and keep asking for 29 #1178
Comments
you can try
|
@goodjun You totally missed the point, I have it already on the latest version (9.0.0) the problem is that the build process is ignoring the target platform, which is can be set and changed manually from Android studio but not in the command line, as for me I do that using Dockerfile. You can refer to https://github.com/capellasolutions/ionic-cordova-docker use develop branch if you want to see this issue. |
I think this might be a cosmetic issue. I was using this the other day and despite the cordova build output stating using android-29, the final output of both an apk or app bundle still produced api 30 package. Are you able to confirm you see the same behavior? |
@breautek Ok I got what you are saying, so it seems the value is not ignored: That's If I installed 29, but If I installed platform 30, I get the error. |
@breautek I just updated develop branch here https://github.com/capellasolutions/ionic-cordova-docker/tree/develop so you can run |
Adding to the importance of resolving this issue is very soon Google store won't accept submission of sdk level less than 30. |
We'll need to update this version in the near future. |
This is not related to this issue. Targeting API 30 still works via The issue described in this ticket is Cordova will still attempt to the default platform SDK (currently API 29) even when targetSdkVersion is set to a different API level. So the current workaround is to simply have both platform 29 & 30 installed. I've had a chance to do some digging on the cause and I've found 3 things that Cordova tooling must do: (1) Ensure compileSdkVersion matches targetSdkVersion
There isn't any real reason to have a There is currently no (2) Ensure android/project.properties has the correct targetCurrently, Cordova does not modify the (3) Ensure android/CordovaLib/project.properties has the correct targetCurrently, Cordova does not modify the Additionally, a warning should be printed for when the SDK is overridden and uses a value other than the Cordova default target SDK, similar to the min sdk override warning. Using an alternate SDK level is not really a supported feature, so this preference is more-or-less "use at your own risk" (and really should be documented as such). All 3 actions must be done in order for the AGP to not download API 29. I cannot give any timeline for when I'll personally be able to do the above, but I'll support any PR that does what is described above. ICYMI: You can workaround this issue by installing both Platform 29 & 30. You can still build APKs targeted against API 30. |
Actually, is enough to install platform-29, installing platform 30 won't be effective and pointless anyway because of other gradle project properties files, that what I was able to do and build using my docker file even with |
As noted in my notes above but the workaround will still build a target 30 SDK, which will still enable API changes that API 30 will introduce. If using API 30 platform SDK is a requirement, a temporary full workaround is to modify the following: /platforms/android/project.properties:
/platforms/android/CordovaLib/project.properties:
Currently the compile SDK version is can be overrided using the
Lastly, of course you still need the
Cordova may overwrite changes to files inside |
hi again guys. task cdvPrintProps { but it's showed me an error. Did you has another suggestion to see it? |
I was able finally to build it using Until this issue is resolved here, maybe in cordova-android 10 or 9.something |
@almothafar I believe I have a working fix #1212 Because the PR is based off of the new master which is a development version of You should set that API 29 and only API 29 is ever downloaded/used with that PR. |
Tested and it worked. I changed on config.xml to :
but it didn’t work so, I remove the platform by using :
then add the latest cordova android version :
finally build the project :
It worked! Amazing. You can check it by going to this file. |
Cordova released cordova android 10.0.0 on 20/7/2021 so now we can add android api 30 in our project. and its not asking for android 29.
|
This reverts commit 626ff04.
Hi Chamara... Did you able to compile your ionic app with sdk 30..? Am getting this annoying error message again and again...
|
remove whitelist plugin using |
Thanks a lot... Am a noob to this ionic cordova stuff... You made my day dear... :) Thanks again |
We are in an odd state right now because the current cordova CLI will auto-add the whitelist plugin when you create a new cordova project, which is deprecated and incompatible with the latest major version of cordova-android. The next major cordova CLI will solve this problem. |
If you stick with Cordova 9.1.0 and update config.xml to target Android SDK version 30, you'll need to sign like this: https://stackoverflow.com/a/69473649 -- then all should be well. |
Hi, Unable to access the link.. |
I removed it when this issue was resolved you can see the commit here capellasolutions/ionic-cordova-docker@626ff04 This is the repo, master branch works, develop is not working right now: https://github.com/capellasolutions/ionic-cordova-docker |
Bug Report
Problem
It seems setting targetSdkVersion to 30 not working, it sounds like the same issue as the one closed #846 , I set
<preference name="android-targetSdkVersion" value="30" />
in config.xml and I installed onlyplatform-30
it keeps asking me to install version 29:There is no other information to put but it is the same issue as #846 nothing new.
Version information
What are relevant versions you are using?
Latest everything, Cordova 10 and cordova-android 9.0.0
Checklist
The text was updated successfully, but these errors were encountered: