Error: Unknown host 'jcenter.bintray.com' - android

I'm getting Error: Unknown host 'jcenter.bintray.com'
Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync projectLearn about configuring HTTP proxies in Gradle
at Android Studio 2.2.1.
Can you help me, please?
Here's my code
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.dev.alemappdev.testclevertap"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.clevertap.android:clevertap-android-sdk:3.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.2' // uncomment if using FCM
compile 'com.android.support:support-v4:23.4.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Related

Error in using android dataBinding

There is a problem when I enable dataBinding in app/build.gradle that gives me this error: "Error:Failed to resolve: support-v4". Below is the build file with dependencies and libraries:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
dataBinding {
enabled = true
}
defaultConfig {
applicationId "com.dxhf.studio.databinding"
minSdkVersion 16
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'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.2'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.0.2'
}
I added the support-v4 but it didn't solve the problem and also there is no issue when removing the dataBinding part. What causes the problem?
Update 1.
This is my project level Gradle file.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.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
}

Android Studio Gradle DSL method not found: 'compile()'

I am getting the following error:
Error:(4, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'Jp' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file.The build file may be missing a Gradle plugin.
I tried looking to other similar questions, but nothing worked.
My build.gradle(Project:JP) file is below:
Error:(4, 0) Gradle DSL method not found: 'compile()'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.jal.jp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":sdk-audio-1.60.1")
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
build.gradle(sdk-audio-1.60.1)
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.jal.jp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":sdk-audio-1.60.1")
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
settings.gradle:
include ':app', ':sdk-audio-1.60.1'
can anyone help me to fix this?
Thanks
Your build gradle tools seem too old, change the following line in the root build.gradle:
classpath 'com.android.tools.build:gradle:1.5.0'
to
classpath 'com.android.tools.build:gradle:2.3.3'
And don't forget to add google maven to your build.gradle too:
maven { url "https://maven.google.com" }
This is because all support library are moved to maven as in the release note at https://developer.android.com/topic/libraries/support-library/revisions.html:
Important: The support libraries are now available through Google's
Maven repository. You do not need to download the support repository
from the SDK Manager. For more information, see Support Library Setup.
So then your root build.gradle will be something like this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Error: Error:Execution failed for task ':app:processDebugGoogleServices'. > Missing api_key/current_key object

After updating my google play services i am getting this error. I am not sure why this is happening. I am trying to implement Firebase for the first time.
Here is my build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my app level gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.deepak.firebasechatapp"
minSdkVersion 11
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.firebase:firebase-database:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
So, can anyone please tell me where is the problem?
Try re-syncing your api key with firebase
Go to Tool->Firebase and in the assistant that opens choose your service and hit "Connect to Firebase"
Solved it for me

gradle is not resolving any new dependencies in android studio

I am making an Intro for my app.So after some research i had got an github project which is used to make cool intros.It requires following dependencies :
compile 'com.github.paolorotolo:appintro:4.0.0'
when I compile it with gradle it gives me following errors:
Failed to resolve: com.github.paolorotolo:appintro:4.0.0
I have done some research on internet but anything didn't worked out.
here is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.adarsh.testapp"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.github.paolorotolo:appintro:4.0.0'
}
and here is my build.gradle(project:testapp)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I solved my issue by just adding mavenCentral() in repositories in build.gradle.

Gradle/Android Studio doesn't pull dependencies from specified repositories

NOTE: This is a followup of my last question that still remained unsolved.
I'm using a fully updated AndroidStudio with the default gradle support.
Android Studio can self update (thus sees Internet for sure).
I have no reason to beleive that Gradle can't reach the internet nor any error that could imply that, and I verified that it's not on offline mode.
Here's my Here's my top-level build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// 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" }
}
}
and here's my app/build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.domain.app"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.github.jitpack:android-example:1.0.4'
}
Here I'm trying to pull the jitpack.io sample, and still getting:
Error:(31, 13) Failed to resolve: com.github.jitpack:android-example:1.0.4
without any additional information.
try this :
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Then in your app/build.gradle :
apply plugin: 'com.android.application'
repositories {
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.domain.app"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.github.jitpack:android-example:1.0.4'
}
Its not the problem of android studio, To inform you
Neither
compile 'com.github.jitpack:android-example:1.0.4'
Nor
compile 'com.github.User:Repo:Tag'
Both doesn't compile now, Because it's no longer available in the The Central Repository. You don't have any ways rather than seeing the codes inside.

Categories

Resources