Failed to resolve com.google.android.gms play-services-auth:11.4.0

Failed to resolve com.google.android.gms play-services-auth:11.4.0 . Add maven { url “https://maven.google.com” } to your root level build.gradle file allprojects { repositories { jcenter() maven { url “https://maven.google.com” } } } This maven repo is required starting from 11.2.0. You can also use the google() shortcut but check the requirements before using it. Also pay attention … Read more

using facebook sdk in Android studio

NOTE For Android Studio 0.5.5 and later, and with later versions of the Facebook SDK, this process is much simpler than what is documented below (which was written for earlier versions of both). If you’re running the latest, all you need to do is this: Download the Facebook SDK from https://developers.facebook.com/docs/android/ Unzip the archive In … Read more

HttpClient won’t import in Android Studio

HttpClient is not supported any more in sdk 23. You have to use URLConnection or downgrade to sdk 22 (compile ‘com.android.support:appcompat-v7:22.2.0’) If you need sdk 23, add this to your gradle: android { useLibrary ‘org.apache.http.legacy’ } You also may try to download and include HttpClient jar directly into your project or use OkHttp instead

Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1

It happens because com.android.support:appcompat-v7:29.x.x doesn’t exist. You can check the revision history in the official doc. You can: Use the last 28.0.0 release of the support library migrate to androidx Also check this note: Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX … Read more

Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Update 2 (Follow this approach) You shouldn’t do this now. Instead fix all the errors. This is only a workaround until it’s removed. After that, you’ll need to fix errors manually anyways. Try to update your gradle plugin to 3.3.0-alpha06 to check if that fixes your issue. Update 1: Non-ascii characters issues have been fixed … Read more

Error:(1, 0) Plugin with id ‘com.android.application’ not found

Updated Answer (Dec. 2, 2020) Latest Gradle: 6.5 Version check: ./gradlew -v How to update: Set URL: ./gradlew wrapper –gradle-version=6.5 –distribution-type=all Update: ./gradlew wrapper Latest Android Gradle Plugin: 4.1.0 If you add the following code snippet to the top of your build.gradle file. Gradle will update the build tools. buildscript { repositories { google() // … Read more

How to create a release signed apk file using Gradle?

Easier way than previous answers: Put this into ~/.gradle/gradle.properties RELEASE_STORE_FILE={path to your keystore} RELEASE_STORE_PASSWORD=***** RELEASE_KEY_ALIAS=***** RELEASE_KEY_PASSWORD=***** Modify your app/build.gradle, and add this inside the android { code block: … signingConfigs { release { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD // Optional, specify signing versions used v1SigningEnabled true v2SigningEnabled true } } buildTypes { … Read more

What is the difference between compileSdkVersion and targetSdkVersion?

compileSdkVersion The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error. … Read more

Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”

As of Android Studio version 0.8.14 You should add: android { packagingOptions { exclude ‘META-INF/LICENSE.txt’ exclude ‘META-INF/NOTICE.txt’ exclude ‘…’ } } to your build.gradle file. History: According to comment 14 in this bug: https://issuetracker.google.com/issues/36982149#comment14 this is a bug in v0.7.0 of the Android Gradle plugin, and is due to be fixed soon in 0.7.1. Here … Read more

tech