I am getting some issue while updating compilesdk and targetsdk to 33.
And if I set compilesdk or targetsdk to 32, 31 or less, I get another library support issue during compilation, as described below...
1. Dependency 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.0-alpha02' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
and getting this same issue with all newly added library to the gradle
I'm not sure if this is a sdk 33 or library issue.
I already tried this--->https://stackoverflow.com/questions/30684613/android-studio-xml-editor-autocomplete-not-working-with-support-libraries/54007742#54007742
Please Refer this link. There is issue in Android Studio Chipmunk Version. Google Team fixed in Android Studio Dolphin. Check Issue Tracker as well
Replace
def lifecycle_version = "2.6.0-alpha02"
with
def lifecycle_version = "2.4.0-rc01"
in build.gradle(app) file.
Please refer to this link for screenshot.
Related
6 issues were found when checking AAR metadata:
Dependency 'androidx.appcompat:appcompat-resources:1.6.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.appcompat:appcompat:1.6.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.activity:activity:1.6.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.core:core:1.9.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.core:core-ktx:1.9.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
I was trying to run a code
Upgrade your compile Sdk and target Sdk 32 to 33 Or change your 'androidx.appcompat:appcompat' library version from 1.6.0 to 1.5.1.
In your project directory go to :
Gradle Scripts > build.gradle(Module : ___)
android {
compileSdk 32 **(-> Change 32 to 33)**
...
}
Dependency 'androidx.appcompat:appcompat-resources:1.6.1' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
How do I fix this android studio roblem?
I clearly had no idea what should I do
This is a dependency version contrast issue just replace your appcompact and ktx with these
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
I'm having some trouble getting my app to compile whilst using Navigate-Compose, is it currently possible to produce apps for an SDK this low, or should I increase my minimum SDK?
Set the compileSdk version to 31 in your gradle.build file, such has this:
android {
compileSdk 31
defaultConfig {
.....
Note that this won't affect the target minimum SDK version, that can still be as low as 21, it is just the version it will be compiled with.
I have a project using the long since deprecated Maps V1 API, on which I have put in a lot of work and I need it.
I have just upgraded Studio to 3.5 and my current version for which I accepted the recommendations to upgrade the gradle plugin and gradle to versions 3.5.0 and 5.4.1 can't find the maps package on line such as:
import com.google.android.maps.GeoPoint;
Fortunately I have a previous version which barely differs and I didn't accept the upgrade recommendations for the plugin and gradle. The versions are 3.4..2 and 5.1.1. It builds successfully.
The relevant parts of my build.gradle (which is the same for both projects) are:
apply plugin: 'com.android.application'
android {
signingConfigs {
...
}
compileSdkVersion 'Google Inc.:Google APIs:15'
//compileSdkVersion 15
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "uk.co.secret.gridmaps"
minSdkVersion 8
targetSdkVersion 10
}
}
dependencies {
implementation 'org.osmdroid:osmdroid-android:5.2#aar'
// NBT TRY 26 AUGUST 2019
//implementation 'com.google.android.gms:play-services.maps:15.0.0'
}
Uncommenting the last line (as suggested in similar questions) doesn't help either:
ERROR: Failed to resolve: com.google.android.gms:play-services.maps:15.0.0
All suggestions will be gratefully received.
UPDATE 19:00 GMT
I can fix this in a very dirty hard-coded way by adding the line
implementation files ('libs/googleapi21maps.jar')
to the dependencies section of build.gradle. That jar file is just a renamed version of C:\dev\tools\android-sdk-windows5.0\add-ons\addon-google_apis-google-21\lib\maps.jar from my old Windows eclipse project
Given that maps API V1 is dead, it does no harm but it's not elegant at all.
Also given that gradle 5.1.1 can find the package without resorting to this inelegant method, why can't gradle 5.4.1?
Update 2
It builds OK but when I invoke an activity that uses the android.maps, it crashes with an IncompatibleClassChangeError. I changed the version of the libs.jar to 15 with no improvement.
I need to make the latest gradle have backward compatibility with legacy code, even if I have to give an explicit reference to the library that gradle 5.1.1 retrieved.
The compileSdkVersion looks stange, that should be eg. 28 (or 29).
And the current play-services-maps version is 17.0.0:
implementation "com.google.android.gms:play-services-location:17.0.0"
implementation "com.google.android.gms:play-services-maps:17.0.0"
mavenCentral() also has a newer version of osmdroid-android:
// https://mvnrepository.com/artifact/org.osmdroid/osmdroid-android
implementation "org.osmdroid:osmdroid-android:6.1.0"
In Android Studio 3, I'm seeing this issue:
The specified Android SDK Build Tools version (26.0.0) is ignored, as
it is below the minimum supported version (26.0.2) for Android Gradle
Plugin 3.0.0.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.0'" from
your build.gradle file, as each version of the Android Gradle Plugin
now has a default version of the build tools.
The problem is that because these are third-party/vendor modules that have buildToolsVersion '26.0.0', I can't modify their build.gradle without forking each submodule.
Is there a way to set a global buildToolsVersion that will override all the sub build.gradles?
Here if you are referring to my previous answers Here is an Update.
1. Compile would be removed from the dependencies after 2018.
a new version build Gradle is available.
Use the above-noted stuff it will help you to resolve the errors. It is needed for the developers who are working after March 2018. Also, maven update might be needed. All above answers will not work on the Android Studio 3.1. Hence Above code block is needed to be changed if you are using 3.1. See also I replaced compile by implementation.
Open app/build.gradle file
Change buildToolsVersion to buildToolsVersion "26.0.2"
change compile 'com.android.support:appcompat to compile 'com.android.support:appcompat-v7:26.0.2'
Solution to this problem is simple
Go to build.gradle (module.app) file
It will help us to rebuild gradle for the project, to make it sync again.
Update to Android Studio 3.0.1 which treats these as warnings.
Android 3.0 was treating such warnings as errors and hence causing the gradle sync operation to fail.
Set the buildToolsVersion '26.0.2' then change classpath 'com.android.tools.build:gradle:3.0.1'.
Make sure you set compileSdkVersion to 26 whiles targetSdkVersion is also set 26.
It is also appropriate to sent set compile 'com.android.support:appcompat-v7:26.0.2'.
just clean and make project / rebuilt fixed my issue give a try :-)
invalidate cache in android studio will resolve this issue. Go to file-> click on invalidate cache/restart option.
Many times as API's are updated. We forgot to update SDK Managers. For accessing recent API's one should always have highest API Level updated if possible should also have other regularly used lower level APIs to accommodate backward compatibility.
Go to build.gradle (module.app) file
change compileSdkVersion
buildToolsVersion
targetSdkVersion, all should have the highest level of API.