Andrew Fletcher published: 1 August 2022 1 minute read
Android Studio build errors
Build failed error: cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
or
cannot find symbol Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
To resolve - upgrade the compileSdkVersion and targetSdkVersion to 31 in your grade file. Note, this setting could be in one of the following files
- android/app/build.gradle
- android/variables.gradle
Also note - Build.VERSION_CODES.R only exists in API 30.
The compileSdkVersion should be set to 30 if you want to use Build.VERSION_CODES.R.
Update for cordova-android@10... As of cordova-android@10, compileSdkVersion has been removed android-targetSdkVersion is unified to set both the target & compile SDK versions so that they always remain consistent.
Related articles
Andrew Fletcher
•
29 Sep 2024
Managing app versioning in Android Studio - simplifying versionCode, versionName, and versionNameSuffix
Versioning is an important aspect of any mobile app development process. In Android, this is handled through versionCode and versionName, which allow you to define the current state of your app for users and the Play Store. But where exactly should these be managed, and how can you ensure they...
Andrew Fletcher
•
31 Oct 2023
Android icon not changing
If the Android app icon is not changing from the default icon (in my situation this was the Capacitor icon), here are some steps to troubleshoot and resolve the issue: Check the Icon FilesEnsure that you have provided the correct icon files in the appropriate directory. In a Capacitor project,...
Andrew Fletcher
•
27 Oct 2023
Working through android.permission.REQUEST_INSTALL_PACKAGES blocking releases
I'm receiving an issue with a previous release on Google Playandroid.permission.REQUEST_INSTALL_PACKAGESI'm seeing the following message in Google PlayRequest install packages permission
error - Not started - Your app isn't compliant
A permission that allows your app to install packages. If your...