Problem downloading com.google.gms:google-services:4.3.10 after adding it as a classpath to the project build.gradle file - android

I started to get this error after trying to connect my app to firebase.
This is the error message I get after the gradle build
Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.10/google-services-4.3.10.pom'. Received status code 405 from server: Method Not Allowed
Project build.gradle file content
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle file content
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
}
//apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.daniel_sogbey.marmap"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildToolsVersion '31.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
googleServices { disableVersionCheck = true }

Your Gradle files look fine, but it looks like your system is unable to contact the Google repository.
Make sure you don't have a firewall running that blocks access.
You can unblock only the firewalls that are active leaving the inactive ones
still still running if you are on a windows machine.

Related

Could not resolve all files for configuration ':app:debugCompileClasspath' while adding a 3rd party library

I'm trying to add a library to apply page curl effect animation in android and after adding the dependency and click on sync it worked fine but when I try to run the app its giving me an error as:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
I searched about it in google and tried different solutions like toggle offline mode and toggle online mode, adding maven { url 'https://maven.google.com' } to project level repositories but nothing worked for me.
I'm attaching the app level gradle file and project level gradle file below.
Any help would be really helpful. Thanks in advance.
app level build.gradle file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.animations"
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.airbnb.android:lottie:3.4.0"
implementation("androidx.dynamicanimation:dynamicanimation:1.0.0")
implementation 'app.num.numandroidpagecurleffect:numandroidpagecurleffect:1.0'
}
project level build.gradle file
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle file
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "Animations"
include ':app'

Failed to resolve library

I know there are a lot of questions like this, but none of them worked for me.
I tried using settings.Gradle, adding "www."
I'm using jitpack to publish my android library in a GitHub repo
my app-level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.realdev.betrage"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.github.RealDev05:ColorPickerDialog:0.2.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.palette:palette:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
my project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.Gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My jitpack logs : logs
My library : ColorPickerDialog

Android Studio library(air location) not working

below is the gradle file
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 32
defaultConfig {
applicationId "org.classapp.test4"
minSdk 24
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'com.github.mumayank:AirLocation:2.5.2'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.gms:play-services-maps:18.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Here is the Gradle Module file
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } // this line
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Error Message
I've been trying to use this github library but it doesn't seem to be working.
So far I have try changing the version but it still doesn't work. Does anyone have any ideas on what to do?
Make sure that Android Studio is able to download the repository.
Open the Preferences, by clicking File > Settings.
In the left pane, click Build -> Execution -> Deployment -> Gradle.
Uncheck/disable the Offline work checkbox.
Click Apply or OK.

some kotlin library attached to the project where compile with newer kotlin compiler and it can't be read... No update found

Hi here I am try a payment project using Amazon Payment Services Android SDK. Here I am successfully done the payment functionality and it's works well. After implementing into main projects I got following issue.
some kotlin library attached to the project where compile with newer kotlin compiler and it can't be read... No update found
In My Gradle
buildscript {
ext.kotlin_version = "1.6.0"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://android-sdk.payfort.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
In Module
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.android.paymentdemoapp"
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation("com.amazon:fortpayment:+:release#aar"){
transitive = true
}
}
I'm modifying the kotlin version(1.6.10 to 1.4.32) and 'build:gradle:4.1.0' to 4.1.2 clean and rebuild the project I got the following issue...
e: /Users/raja/.gradle/caches/transforms-2/files-2.1/2a57ced0732a783c670dc97c999acc46/jetified-core-ktx-1.8.0-alpha03-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
I'm tried to configure the kotlin version and Gradle build version different way but there is no use. Anyone please help me to fix this issue. Thanks in advance.

amplify android gradle build error EEXIST: file already exists, mkdir

I am trying to follow this tutorial for AWS Amplify Android.
I am sure I did everything mentioned over there.
This is how my Gradle files look like.
My project Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.amplifyframework:amplify-tools-gradle-plugin:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.amplifyframework.amplifytools'
This is my app Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.example.demoapp"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.amplifyframework:core:1.0.0'
implementation 'com.amplifyframework:aws-datastore:1.0.0'
implementation 'com.amplifyframework:aws-api:1.0.0'
}
As soon as i remove apply plugin: 'com.amplifyframework.amplifytools', it builds successfully.
My node version is 12.17.0.
npm version is 16.14.4.
It is giving me this errors:
EEXIST: file already exists, mkdir 'C:\Users\Ram'
Node.js is not installed. Visit https://nodejs.org/en/download/ to install it.
You can file this as an issue against our GitHub repo here and we'll take a look: https://github.com/aws-amplify/amplify-android

Categories

Resources