Android Studio “IDE error occured” after update - android

My app worked fine but after running it a few times I got a problem with the gradle build. (Android Studio: failed to complete gradle execution, cause is empty) i've restarted my computer and before trying to fix the issue it showed me that I have an update for a few thing in android studio. After the update it asked me to update some versions of implementation in the gradle and then the "com.google.gms:google-services" version in the project gradle. After doing so I get an error saying "IDE error occured" when trying to do a build.
The exception is occuring in the Android Support Plugin.
The exception details:
null
java.lang.NullPointerException
at com.android.tools.idea.run.tasks.InstantRunNotificationTask.<init>(InstantRunNotificationTask.java:64)
at com.android.tools.idea.fd.InstantRunBuildAnalyzer.getNotificationTask(InstantRunBuildAnalyzer.java:188)
at com.android.tools.idea.run.AndroidLaunchTasksProvider.getTasks(AndroidLaunchTasksProvider.java:122)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:102)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:713)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Project 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:3.1.0'
classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Module gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId 'com.example.elaymac.randochat'
minSdkVersion 15
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'
}
}
productFlavors {
}
}
dependencies {
implementation 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.firebaseui:firebase-ui-database:3.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
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.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
Thanks!

I solved the problem thanks to Severiano Jaramillo Quintanar's answer!
I faced the exact same problem, I was afraid I broke something... I
fixed it by cleaning and rebuilding the project (I had disabled
instant run as suggested here before but I guess that was not
necessary as I enabled it again after cleaning and rebuilding the
project and worked just fine...).
Build -> Clean Project
Build -> Rebuild Project
I am not sure if rebuilding would be necessary, I did both steps and
it worked fine, maybe just cleaning the project would have been
sufficient.
Hope that helps!!
EDIT
Nice, one more thing. When I solved the problem depicted here I found
another problem, when I clicked run the apk was not being created and
I solved it with my answer on that other thread:
The APK file does not exist on disk

In Android Studio:
Go to File / Invalidate caches.. /
Then select both options and restart
After restarting of Android Studio your problem is solved out

Related

Error in library built with jitpack: Unable to resolve dependency for ':app#debug/compileClasspath'

I am trying to publish my android library on jitpack.io but when I tried to add dependency to test my artifact I am getting this error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.pashaoleynik97:GSBarcodeScannerHelper:0.1.1-alpha.
Open File
Show Details
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.github.pashaoleynik97:GSBarcodeScannerHelper:0.1.1-alpha.
Open File
Show Details
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.github.pashaoleynik97:GSBarcodeScannerHelper:0.1.1-alpha.
Open File
Show Details
Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve com.github.pashaoleynik97:GSBarcodeScannerHelper:0.1.1-alpha.
Open File
Show Details
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.github.pashaoleynik97:GSBarcodeScannerHelper:0.1.1-alpha.
Open File
Show Details
My gradle files in library project are listed below.
My build.gradle (app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.github.pashaoleynik97.gsbarcodescannerhelperdemo"
minSdkVersion 21
targetSdkVersion 28
versionCode 2
versionName "1.1"
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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 project(':gsbarcodescannerhelper')
}
My build.gradle (gsbarcodescannerhelper):
apply plugin: 'com.android.library'
group='com.github.pashaoleynik97;'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 2
versionName "0.1.1"
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'
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 'org.jetbrains.kotlin:kotlin-stdlib:1.3.10'
implementation(name: 'generalscan-sdk-1.0.6', ext:'aar')
}
And finally, my build.gradle (project):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs project(':gsbarcodescannerhelper').file('libs')
}
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I pushed my project on github, created release (through github web interface), then went to jitpack.io and published my library. But when I tried to add this library to my new test project I had errors (listed in top of this post). What I am doing wrong?
UPD
I also tried to add classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' like in this docs: https://jitpack.io/docs/ANDROID/
But result remains the same.
UPD 2
Created issue: https://github.com/jitpack/jitpack.io/issues/3758
This seems to be a persisting issue for a few days, can be found here, the link mentions a workaround here. The workaround is to add www with the jitpack.io. Hence update it to the following:
maven { url 'https://www.jitpack.io' }
Jitpack is very sensative tool. There are a multitude of reasons why this issue comes up. I will try to itemized them.
1) Failing Unit Tests; if you have any failing unit tests, you will be able to create the artifact on jitpack (with no reported issues) but will be unable to reference the artifact. Make sure all your unit tests are working properly.
2) It is advisable that you include in your project level gradle for the project intended to be the artifact, the following:
Top of Project Level Gradle
apply plugin: 'maven-publish'
group = '<add-your-package-name-here>'
and at the very bottom of your project level gradle include
apply from: 'https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/master/gradle-mavenizer.gradle'
Now generate an artifact and see if the reference works
3) Private artifact? Maybe you are not referencing your artifact correctly. If your repo is private, be sure to add the auth token in gradle.properties and then reference it on the project level gradle like this,
gradle.properties
authToken=jp_myfake_token
Project Level Gradle:
maven {
url "https://jitpack.io"
credentials{ username authToken }
}
4) Wait a hour. For whatever reason there is syncing and caching issues with Jitpack. Sometimes all you have to do is wait a hour (or two) and everything starts to work.
Hopefully one of these will help you resolve your issue. Jitpack has easy setup, but it is buggy.
make sure that you add maven { url "https://jitpack.io" }
in build.gradle (Project Level) like this:
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
also, make sure that's your Gradle offline mode is disabled
Now it is free only for public repositories...
If you put your repository url in https://jitpack.io and looked up, you will see the following message as log:
Subscription not active

Android Studio Gradle Sync Error using google play-services-maps 11.6.2

I am developing a google map app using Android Studio. When I sync the project with Gradle Files (Select Tools/Android/Sync Project with Gradle Files on Android Studio), I get the following error:
Could not resolve com.google.android.gms:play-services-maps:11.6.2.
Couold not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-maps/11.62./play-services-maps-11.6.2.pom
This is the software I am using:
Android Studio 3.0.1
Android Version 7.1.1
Google Play Services 46
Google Repository 58 (under Support Repository)
I've tried using both the google maps project template and the empty activity project but I get the same error.
I am using the http proxy setup I used from earlier projects. I am able to install the play-services-maps and the google repository.
I also added the maven url to the Gradle Project file in the All Projects/Repositories section.
I have tried the suggestions from Stack Overflow but none have not worked.
Any ideas?
Gradle Project Build file:
// 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.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://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The gradle app build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "hansen.scott.googlemaps"
minSdkVersion 25
targetSdkVersion 26
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:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-maps:11.6.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
The error is in the line:
implementation 'com.google.android.gms:play-services-maps:11.6.2'
try adding this in project level gradle file
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
Someone had the same issue I did and entered it on Stack Overflow a day or two ago. The user was getting a build error when using player-services-maps 11.6.2. If the user changed the version to 11.0.0, the build succeeded.
Once I back-dated the maps version to 11.0.0, this solved my problem too. I created a new Google Map project and didn't modify the Gradle Build files.
The problem appears to be that play-services-maps won't build using a versions after 11.0.0. I will post the issue on Github.
Thank you for everybody's help.
I have been facing the same issue for the past one week and posted it on Stack Overflow as well but to no effect.
I have since then figured out the root cause. I am working out of my office and thus have firewalls in place. I got it checked with the system admin and on turning off the firewall the build worked.
So i would advice you to have this checked as well.
Kind regards,
Kabir

Could not resolve com.android.support:appcompat-v7:26.1.0 in Android Studio new project

I know about this questions:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
Could not resolve com.android.support:appcompat-v7:26.1.0 [duplicate]
And I've read this documentations:
Migrate to Android Plugin for Gradle 3.0.0
Migrating to Android 8.0
So I'm posting this question believing its not a duplicate.
I've installed Android Studio 3.0.1. I didn't have any previous version before and I started a new project.
Every setting in Gradle file have been set by Android Studio itself and I've checked them all.
These are the file contents:
build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.administrator.as301test"
minSdkVersion 16
targetSdkVersion 26
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:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Top level build.gradle
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
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
I use google() in repositories as here clearly says:
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
My gradle version is 4.1 so I don't need above code.
But I still get this error as the others have been asking about:
Error:Unable to resolve dependency for ':app#debug/compileClasspath':
Could not resolve com.android.support:appcompat-v7:26.1.0.
Why should I get this error when I'm creating a new project in AS 3.0.1 and it has been set all the necessary settings?
Update
#Rohit's answer somehow solved the issue but I still get same error for some other dependencies.
Could not resolve com.android.support.test:runner:1.0.1
Could not resolve
com.android.support.test.espresso:espresso-core:3.0.1
Could not resolve junit:junit:4.12
Finally I fixed the problem by modifying build.gradle like this:
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
}
I've removed these lines as these will produce more errors:
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
Also I had same problem with migrating an existing project from 2.3 to 3.0.1 and with modifying the project gradle files like this, I came up with a working solution:
build.gradle (module app)
android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.mobaleghan.tablighcalendar"
minSdkVersion 16
targetSdkVersion 27
}
dependencies {
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support:design:25.1.0'
implementation 'com.android.support:preference-v7:25.1.0'
implementation 'com.android.support:recyclerview-v7:25.1.0'
implementation 'com.android.support:support-annotations:25.1.0'
implementation 'com.android.support:support-v4:25.1.0'
implementation 'com.android.support:cardview-v7:25.1.0'
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
}
Top level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
goto Android->sdk->build-tools directory make sure you have all the versions required . if not , download them . after that
goto File-->Settigs-->Build,Execution,Depoyment-->Gradle
choose use default gradle wapper (recommended)
and untick Offline work
gradle build finishes successfully for once you can change the settings
If it dosent simply solve the problem
check this link to find an appropriate support library revision
https://developer.android.com/topic/libraries/support-library/revisions
Make sure that the compile sdk and target version same as the support library version.
It is recommended maintain network connection atleast for the first time build (Remember to rebuild your project after doing this)
try this :
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
targetSdkVersion 26
}
}
compile 'com.android.support:appcompat-v7:25.1.0'
It has worked for me
I tried all of the above and nothing worked for me.
Then I followed Gradle Settings > Build Execution, Deployment > Gradle > Android Studio and checked "Disable embedded Maven repository".
Did a build with this checked and the problem was solved.
Just go to
File\Settings\Gradle. Deselect the "Offline work" box. Now you can connect and
download any necessary or missing dependencies
Your android studio may be forgot to put :
buildToolsVersion "26.0.0"
you need 'buildTools' to develop related design and java file. And if there is no any buildTools are installed in Android->sdk->build-tools directory then download first.
well got this answer from another site and don't want to take any credit for this but this solution works like butter.
Go to File\Settings\Gradle. Deselect the "Offline work" box. Now you can connect and download any necessary or missing dependencies.
This work for me. In the android\app\build.gradle file you need to specify the following
compileSdkVersion 26
buildToolsVersion "26.0.1"
and then find this
compile "com.android.support:appcompat-v7"
and make sure it says
compile "com.android.support:appcompat-v7:26.0.1"
OK It's A Wrong Approach But If You Use it Like This :
compile "com.android.support:appcompat-v7:+"
Android Studio Will Use The Last Version It Has.
In My Case Was 26.0.0alpha-1.
You Can See The Used Version In External Libraries (In The Project View).
I Tried Everything But Couldn't Use Anything Above 26.0.0alpha-1, It Seems My IP Is Blocked By Google. Any Idea? Comment
In my case, this error occur when i tried to use gridView
I resolved it by removing this line from build.grade(Module) file
implementation 'com.android.support:gridlayout-v7:28.0.0-alpha3'
This issue seems to like the following.
How to resolve repository certificate error in Gradle build
Below steps may help:
1. Add certificate to keystore-
Import some certifications into Android Studio JDK cacerts from Android Studio’s cacerts.
Android Studio’s cacerts may be located in
{your-home-directory}/.AndroidStudio3.0/system/tasks/cacerts
I used the following import command.
$ keytool -importkeystore -v -srckeystore {src cacerts} -destkeystore {dest cacerts}
2. Add modified cacert path to gradle.properties-
systemProp.javax.net.ssl.trustStore={your-android-studio-directory}\\jre\\jre\\lib\\security\\cacerts
systemProp.javax.net.ssl.trustStorePassword=changeit
Ref : https://www.cresco.co.jp/blog/entry/2014//
Try to clear cache in android studio by
File-> Invalidate cache -> invalidate
after invalidating
build-> clean project
Then you can able to build the project
this work for me
compile 'com.android.support:appcompat-v7:26.0.0'
change 26.0.0 to 26.0.1
compile 'com.android.support:appcompat-v7:26.0.1'
this work for me. add configurations.all in app/build.gradle
android {
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}
}

Error:Could not find com.android.tools.build:gradle:3.3. Issue raise after upgrading gradle version for splunk:mint-android-sdk

My App was working fine, then i add com.splunk:mint-android-sdk, which required upper version of gradle, so i upgrade the gradle to from 2.1 to 3.3. after that i am facing issues. Please review my gradle file and help me out and please guide me how it work.( This is my first app but i want sure make its should be working fine in all scenario )
Error:Could not find com.android.tools.build:gradle:3.3.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.jar
https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.pom
https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.jar
Required by:
:MyApp:unspecified
My gradleare
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.abc.myApp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled= true
manifestPlaceholders = [onesignal_app_id: "hjaadsffsddd8-2e6hgf-4fdsasdfgb63-8dad5-1111111",
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:+'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.onesignal:OneSignal:[3.6.1,3.99.99]'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.splunk:mint-android-sdk:5.2.1'
}
and
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.splunk:mint-gradle-android-plugin:5.2.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Inside buildscript add google() then open terminal write command-- gradlew build and press enter.
repositories {
google()
jcenter()
}
NB: Make sure you are in active network connection
You changed Gradle plugin version, not Gradle version
Set your Gradle Plugin version to 2.3
Then open gradle/wrapper/gradle-wrapper.properties and change Gradle version at line distributionUrl
Please follow these steps :
Open Your project.
Go to the Left side of the Gradle button.
Click button above image show .
if this type of view you are not in offline mode.
Go to Build and rebucild the project.
The above worked for me.
This version of the gradle plugin doesn't exist.
classpath 'com.android.tools.build:gradle:3.3'
use the latest beta release:
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
Instead if you would like to update gradle, update the distributionUrl in gradle-wrapper.properties.
I resolve my problem removing proxy configuration in file gradle.properties
I've got this error, and the problem was the antivirus Avast blocking android studio from download the files.
so I've disabled it temporary and also runned Android studio as an admin. this solved the problem.
In my case, I add maven { url 'https://maven.google.com' } at top of build script.
Go to the gradle wrapper properties and see if the gradle version in the distribution url matches the one in the build.gradle classpath's
I updated following line of
code: classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
and distributionUrl in gradle-wrapper.properties 'distributionUrl=https\://services.gradle.org/distributions/‌​gradle-3.3-all.zip'
and MOST IMPORTANT is FILE>SETTING>Build,Execution,Deployment>Build Tools>Gradles: Project-level settings: checked :Use default gradle wrapper(recommended)

Android Build Gradle doesn't complete

I had a problem to run android-studios build gradle, so I tested many solution but unfortunately I couldn't solve my problem:
Now i uninstall my old Android studio and Android-sdk , then I download android studio 1.5.1 that contains default SDK .
I install them and I create an empty project , But it take 30 minutes to build project, I will add dialog window that shown in this period of time .
Finally project created with this error :
Error:(23, 17) Failed to resolve: junit:junit:4.12
Could any one help me ,please ?
build.gradle file content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.armangar.app.fortest"
minSdkVersion 23
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')
androidTestCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
top build.gradle file content:
// 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: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
}
testCompile is the configuration for unit tests (located in src/test) and androidTestCompile is used for the test api (located in src/androidTest).
The main distinction between the two is that test runs in a regular Java JVM, and androidTest tests run on an Android device (or an emulator).
So, use
testCompile 'junit:junit:4.12'
instead of
androidTestCompile 'junit:junit:4.12'
source: http://tools.android.com/tech-docs/unit-testing-support
I think you have SSL problem.
Try by replacing
jcenter { url 'http://jcenter.bintray.com' }
with
jcenter()
in both repository blocks in build.gradle file and try to build gradle again.
I change jcenter() to mavenCentral() in build.gradle .
So my problem solved
EDIT:
This issue was related to my proxy . So I could not download from jcenter().
If you have a problem same this one, please check your Internet proxy .

Categories

Resources