org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD ' - java

I was modifying and adding some dependencies in my project and then i got this error:
Metadata of https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom 90ms
and some more errors similar to this one
And for the Event Log:
org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'.
My gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And Module Dependencies:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.hasee.seetravel"
multiDexEnabled true
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
// jniLibs.srcDirs = ['libs']
res.srcDirs = [
'src/main/res/layout/home',
'src/main/res/layout/explore',
'src/main/res/layout/camera',
'src/main/res/layout/schedule',
'src/main/res/layout/me',
'src/main/res/layout/video',
'src/main/res/layout/drop_menu',
'src/main/res/layout',
'src/main/res'
]
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.danylovolokh:video-player-manager:0.2.0'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.shuyu:GSYVideoPlayer:4.0.0-beat1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'cn.jzvd:jiaozivideoplayer:6.2.7'
implementation 'com.white.countdownbutton:countdownbtn:1.0.4'
implementation 'com.github.dongjunkun:DropDownMenu:1.0.4'
implementation 'cn.yipianfengye.android:ad-library:1.0'
implementation 'cn.yc:YCDialogLib:3.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.sackcentury:shinebutton:0.2.0'
implementation 'me.shaohui:bottomdialog:1.1.9'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation files('libs/Android_Map3D_SDK_V6.0.0_20180211.jar')
}
Besides I am a Chinese user but failures also occurred when i turned on my VPN.
Other Settings:
HTTP Proxy:
enter image description here
Installed SDK Platform: Android API 28 & Android 8.1(Oreo)
Gradle Settings:
enter image description here
Please Help

Related

Unable to load class 'com.squareup.javawriter.JavaWriter'

my android project contains Libraries of Firebase, retrofit,and glide. While I am trying to run the application , i get this error.
Unable to load class 'com.squareup.javawriter.JavaWriter'.
This is an unexpected error. Please file a bug containing the idea.log file.
build.gradle(Module)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
buildFeatures {
dataBinding true
// for view binding:
// viewBinding true
}
compileSdkVersion 30
defaultConfig {
applicationId "com.example.golottery"
minSdkVersion 21
targetSdkVersion 30
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 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.lukelorusso:CodeEditText:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'androidx.browser:browser:1.3.0'
}
build.gradle(project)
buildscript {
repositories {
google()
//jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.8'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
How can I resolve this problem? After searching for an hour, only get this Android studio: Error:Could not download javawriter.jar link but it could not work for me.

ERROR: Could not find method android() for arguments

I am facing a problem, when i sync my project this gradle error occurs :(
ERROR: Could not find method android() for arguments [build_4igxve2xutpcfkae0ab7hnkia$_run_closure1#353dd2ed] on project ':app' of type org.gradle.api.Project.
Open File
This is my Build.gradle(project: name)
// 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:3.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my build.gradle(Module:App)
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.instagram"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
//androidTestImplementation 'com.android.support.test:runner28.0.0'
}
apply plugin: 'com.google.gms.google-services'
You appear to be missing this line from the top of your module's build.gradle file:
apply plugin: 'com.android.application'

Problems when i try to use a new places-compat

i try to use a new placesApi, i follow this documentation https://developers.google.com/places/android-sdk/client-migration#place-picker-deprecation, when i run my app, android studio return this
"Error: Type com.google.android.libraries.places.internal.lm is referenced as an interface from com.google.android.libraries.places.internal.fm"
and this:
"Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\14155709.gradle\caches\transforms-1\files-1.1\places-1.0.0.aar\2f69114c5b5de9392ef400dc02f6f031\jars\classes.jar"
this problem starts when i put this: implementation 'com.google.android.libraries.places:places-compat:1.0.0'
and this:implementation 'com.google.android.libraries.places:places:1.0.0'
i need bout implements, i try to search on google but i didn't found noting, pls help me.
this is my gradle project:
// 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:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
this is my gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.motoja.motojapassageiro"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
//maps places
implementation 'com.google.android.libraries.places:places-compat:1.0.0'
//implementation 'com.android.support:cardview-v7:28.0.0'
//implementation 'com.google.android.gms:play-services-places:16.0.+'
implementation 'com.google.android.libraries.places:places:1.0.0'
//google-play
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
// Required only if Facebook login support is required
implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
}
apply plugin: 'com.google.gms.google-services'
These two dependencies might be conflicting each other:
// implementation "com.google.android.libraries.places:places-compat:1.1.0"
implementation "com.google.android.libraries.places:places:1.1.0"
The places-compat wrapper is ordinary not required - better refactor your code to the new library.

Problem with dependencies gradle exception

What the hell is this? I know that I have to upgrade something within my app dependencies but it does not point out what and where!!
org.gradle.api.GradleException: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.5,16.0.5], [16.0.4,16.0.4], [16.3.0,16.3.0]], but resolves to 16.3.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
I added the following dependencies for admob ads and gave me that error :
implementation 'com.google.android.gms:play-services-ads:17.1.1'
Project level gradle :
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level :
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.genesisbc.marketplace"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'

com.android.tools.r8.errors.CompilationError: Program type already present: androidx.versionedparcelable.NonParcelField

## error ##
java.lang.RuntimeException:com.android.build.api.transform.TransformException:
Error while generating the main dex list.
com.android.build.api.transform.TransformException: Error while generating the main dex list.
com.android.builder.multidex.D8MainDexList$MainDexListException:
com.android.tools.r8.errors.CompilationError: Program type already
present: androidx.versionedparcelable.NonParcelField
com.android.tools.r8.errors.CompilationError: Program type already present: androidx.versionedparcelable.NonParcelField
app's buid gradle
apply plugin: 'com.android.application'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mikal.meroshop"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
manifestPlaceholders = [onesignal_app_id : "1:1063090093562:android:450b13f7ba80306d",
onesignal_google_project_number: "REMOTE"]
multiDexEnabled true
}
buildTypes {
/* debug {
minifyEnabled true
useProguard true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}*/
release {
minifyEnabled false
shrinkResources false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
preDexLibraries = false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.tomer:fadingtextview:2.5'
implementation 'com.github.Gavras:MultiLineRadioGroup:v1.0.0.6'
implementation 'com.github.florent37:materialtextfield:1.0.7'
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.github.bumptech.glide:glide:3.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.tomer:fadingtextview:2.5'
implementation 'com.github.florent37:materialtextfield:1.0.7'
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
implementation 'com.kaopiz:kprogresshud:1.1.0'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.mikepenz:aboutlibraries:6.1.1#aar'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.mikepenz:crossfadedrawerlayout:1.1.0'
implementation 'com.mikepenz:materialdrawer:6.1.1'
// implementation 'androidx.appcompat:appcompat:1.0.2'
implementation "com.mikepenz:materialize:1.2.0"
implementation 'com.webianks.library:easy-feedback:1.0.2'
implementation 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.onesignal:OneSignal:3.10.3'
implementation 'com.github.GrenderG:Toasty:1.2.5'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.yesidlazaro:GmailBackground:1.2.0'
// implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-config:16.1.2'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.firebaseui:firebase-ui:1.2.0'
// implementation 'com.firebaseui:firebase-ui-database:1.2.0'
//implementation 'com.google.android.gms:play-services:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.6'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation ('com.android.support:multidex:1.0.3')
{
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
}
}
apply plugin: 'com.google.gms.google-services'
project buid gradle
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven{url "https://dl.bintray.com/android/android-tools" }
}
/*tasks.withType(JavaCompile) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}*/
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If a class appears more than once on the runtime classpath, you get an error similar to the following:
Program type already present com.example.MyClass
In your case its androidx.versionedparcelable.NonParcelField so
Just remove dependency androidx.versionedparcelable 1.1.0-alpha01(what ever version you are using) from your build.gradle
Check Official Doc

Categories

Resources