Unable to build gradle and create java class - java

Any project in my android studio fails to build.The error message is as follows-
Gradle sync failed: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.3-all.zip'.
Consult IDE log for more details (Help | Show Log)
Moreover i'm unable to make a new java class in android studio by File->new->Java class as no such option is available. I found some answers saying right click on java folder then clicking Mark Directory as -> SOurce root, even this option is not there . Moreover, for resolving the gradle issue, i found some answers saying click File->Invalidate Caches/Restart and delete the .gradle file in home directory then update android studio, i did accordingly but still nothing works.
build.gradle contents are-
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.android.iitmandi"
minSdkVersion 15
targetSdkVersion 25
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
testCompile 'junit:junit:4.12'
}
Contents of gradle-wrapper.properties are-
#Tue Mar 28 20:10:53 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Build.grale-
// 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.3.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
}
on doing Build->Clean project this error message was shown-
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugUnitTestApkCopy'.
> Could not resolve junit:junit:4.12.
Required by:
project :app
> Could not resolve junit:junit:4.12.
> Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out
I even uninstalled Android-Studio 2.3 and installed 2.2.2 instead but still the problem persists

the code in JUnit library is referenced in the project but there is no related JUnit dependent library yet...you either have to delete the referencing line(s) of code in the gradle or install the JUnit library.For more info https://debugah.com/failed-to-resolve-junitjunit4-12-how-to-solve-11544/

Related

Unable to merge Dex in Android Studio 3.0

I'm a beginner with Android Studio.
Every time I try running my app on my Google Tango tablet, the following error emerges:
Execution failed for task:':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchibeMergerException: Unable to merge dex
This is my app Module build.gradle file...
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.cs15yyo.myfyp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
//multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.tango:sdk-base:1.55'
compile 'com.google.tango:support-base:1.54'
compile 'com.google.tango:sdk-depth-interpolation:1.55'
compile 'com.google.tango:sdk-transform-helpers:1.55'
compile 'org.rajawali3d:rajawali:1.1.668#aar'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
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'
implementation project(':tango_support_java_lib')
implementation project(':tango_ux_support_library')
}
This is my Project build.gradle 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.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my tango_support_java_lib Module build.gradle file...
configurations.maybeCreate("default")
artifacts.add("default", file('tango_support_java_lib.aar'))
This is my tango_ux_support_library Module build.gradle file...
configurations.maybeCreate("default")
artifacts.add("default", file('tango_ux_support_library.aar'))
Attempted Solutions
Looking at existing solutions in StackOverFlow, I've tried the following....
Writing multiDexEnabled true in the buildConfig block of code within the module build.gradle file
Build > Clean Project and afterwards, Build > Rebuild Project
Deleting the .gradle folder, and then running the app
Changing each compile word to compileOnly in the dependencies of my Module build.gradle file.
All have failed me, annoyingly so.
This is for my work on my final year Computer Science project.
I've solved the issue, as it turns out, the cause of the problem was importing JAR/AAR files as libraries AFTER writing the necessary dependencies (in the module build.gradle file) to get the same libraries; therefore, after removing the JAR/AAR files, my app was able to run

"Failed to resolve: com.android.support:support-v4:26.0.0" and other similar errors on Gradle sync [duplicate]

This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Closed 5 years ago.
I have just created a new Android Studio project for both Android Mobile and wear. The initial gradle build failed because I am getting several errors-
Error: Failed to resolve: com.android.support:support-v4:26.0.0
Error: Failed to resolve: com.android.support:percent:26.0.0
Error: Failed to resolve: com.android.support:recyclerview-v7:26.0.0
Error: Failed to resolve: com.android.support:support-annotations:26.0.0
With each error, I am given the option to Install repository and sync project, but nothing happens when I click on it. I have spent several hours trying to find why I am getting these errors, but I can't find any solutions. Does anybody know how to fix these very frustrating errors? Thank you!
build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (mobile)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:appcompat-v7:26+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.android.support:support-core-utils:26+"
testCompile 'junit:junit:4.12'
}
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
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'])
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile "com.android.support:support-core-utils:26+"
}
I am sure that my version of Android Studio is updated, and all support repositories and APIs are installed.
I don't have an Android wear project, but I had the same problem when I wanted to upgrade the Support Library version for an existing project to 26.0.0. Since 26.0.0 the support libraries are available through Google's Maven repository. So I had to add the repository to my build. gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Check out https://developer.android.com/topic/libraries/support-library/setup.html for more details.
The following worked for me:
In the Application build.gradle considered to add following:
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
in the Module build.gradle:
compileSdkVersion 26
buildToolsVersion "26.0.1"
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:support-compat:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-annotations:26.0.1'
compile 'com.android.support:support-vector-drawable:26.0.1'
compile 'com.android.support:animated-vector-drawable:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v13:26.0.1'
compile 'com.android.support:percent:26.0.1'
compile 'com.android.support:wear:26.0.1'
compile 'com.google.android.support:wearable:2.0.4'
provided 'com.google.android.wearable:wearable:2.0.4'
}
Either change your build tool version from 26.0.1 to 26.0.0 or you can replace 26.0.0 by 26.+ like below.
compile 'com.android.support:support-v4:26.0.0'
to
compile 'com.android.support:support-v4:26.+"
Do same with all...
Hope it helps.
Happy Coding! ^_^
For now, I fixed this with changing in the wear build.gradle:
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
It seems like the problem is com.google.android.support:wearable:2.0.4. With that, Using 26.0.1 build tools compiles fine. I haven't gone any further with this but it looks like a dependency problem related to a repository although that is really just a guess from the error messages.
Add the following dependencies in your app/build.gradle.
repositories {
maven { url 'https://maven.fabric.io/public' }
maven{url 'https://maven.google.com'}
}
Replace this:
compile 'com.android.support:recyclerview-v7:26.0.0'
With this
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
Do same with all
Update - new version released
compile 'com.android.support:recyclerview-v7:26.1.0'
Add following dependency in your gradle
Replace
compile 'com.android.support:support-v4:26.0.0'
with
compile 'com.android.support:support-v4:25.0.0'
and Replace
compile 'com.android.support:appcompat-v7:26+'
with
compile 'com.android.support:appcompat-v7:25.0.0'
The reason that my project was giving me these errors was because I created the project for Android Platform 26. However, Wear currently doesn't support 26, and it is essential to change the target and compile SDK versions to 25 in the wear module of build.gradle.
Link to Android Developers documentation - https://developer.android.com/training/wearables/apps/creating.html#setting-up-a-phone
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.findmyphone"
minSdkVersion 25
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'])
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
I only needed to change the compile and target SDK versions to 25 in the wear module. I left them as 26 for the mobile module.
This one worked for me
allprojects {
repositories {
jcenter()
google()
}
}
google() does the magic with the following configuration
Studio version : 3.0 beta 2
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
I meet this problem, changing the build tool/ sdk version didn't work, clearly write compile version didn't work, off line build didn't work.
Finally I just change wearable version, and this problem gone.
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
to
provided 'com.google.android.wearable:wearable:2.0.2'
compile 'com.google.android.support:wearable:2.0.2'
By the way, I used offline building now because it is really fast when I check this issue.

I have an error in Android studio "Failed to resolve junit:4.12"

I created a new project after installing Android Studio 2.3.3 and then the Gradle build failed because of these three errors:
Error:Failed to resolve: junit:junit:4.12
Open FileShow in Project Structure dialog
Error:Failed to resolve: org.hamcrest:hamcrest-library:1.3
Open FileShow in Project Structure dialog
Error:Failed to resolve: org.hamcrest:hamcrest-integration:1.3
Open FileShow in Project Structure dialog
and I tried looking at similar questions and their answers but they didn't work for me.
I tried deleting the testCompile line in gradle.build, and I tried adding the url maven "{ url 'http://repo1.maven.org/maven2' }" in the gradle.build file, and I checked the firewall and I downloaded the junit.jar and nothing worked.
Edit:
build.gradle (module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.tasneem.sunshine"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
build.gradle (project)
// 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.3.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
}
First of all, connect your internet connection then update your junit library.
I figured out a way to fix this. this is not a solution to the error but it will help you run the project if you have the same errors as me and no other method worked. I downloaded a new gradle and extracted it to C:/Users/Username/gradle/wrapper/dist folder then changed the gradle in Android studio from file->settings
I also commented the whole testCompile block in the gradle (module) file and removed junit4.12 from the module settings of the project.
This seemed to fix the problem and I could run the project on my Android device.

New AndroidStudio 2.3 Error

I have just installed new Android Studio and tried to create a new project. But I get this strange error. I am using 32 bit Linux system.
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
Information:BUILD FAILED
Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
Information:Total time: 14.838 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
I don't understand why I am getting this error.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.sandesh.testing"
minSdkVersion 15
targetSdkVersion 25
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Gradle (project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.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
}
In your case problem is newest Android Studio does not run on 32bit only system. On download page you can check the requirement also:
64-bit distribution capable of running 32-bit applications
The newest version does not support 32bit. I think you should try with one solution but I dont know how long it will work :
Step1.Go to terminal
Step2.type gedit .profile
Step3.paste the below line at end of the page
Step4.export ANDROID_EMULATOR_FORCE_32BIT=true
Step5.type source .profile in terminal or restart system
Please remember that may be in future Android Stdio stop supporting this too so its better you should move to bit64 or downgrade your version of android studio.

Gradle fails to resolve dependencies in Android Studio

Whenever I add a dependency from an remote repository (jcenter) in Android Studio 1.1 (OS X) I get the following error upon syncing Gradle:
Error:(26, 13) Failed to resolve: <packagename:version>
My app's build.gradle is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "nl.timmevandermeer.cargoapp"
minSdkVersion 19
targetSdkVersion 21
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 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'org.json:json:20141113'
}
I have tried changing repositories (jcenter(), mavenCentral(), etc.), reinstalling Android Studio, JDK (7 and 8), changing Gradle version and Android SDK version, none of which worked. Upon running ./gradlew build I get:
Could not resolve com.android.tools.build:gradle:1.1.0.
13:48:04.914 [ERROR] [org.gradle.BuildExceptionReporter] Required by:
13:48:04.915 [ERROR] [org.gradle.BuildExceptionReporter] :CargoApp:unspecified
13:48:04.932 [ERROR] [org.gradle.BuildExceptionReporter] >
org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
This is an error I get in other cases as well, for example when trying to use Intellij Idea instead of Android Studio. Running the app without the dependency does work though.
A similar problem here, and when I choose Build -> Clean Project
there is a "peer not authenticated" error.
solved by using "http://jcenter.bintray.com/" instead of "https://jcenter.bintray.com/"
repositories {
jcenter({url "http://jcenter.bintray.com/"})
}
hope this work for you.
I had a similar problem with a library on github, which stated to install it as:
dependencies {
compile 'com.github.chrisbanes.photoview:library:1.2.4'
}
This workaround seem to work, although it's suboptimal because it doesn't fetch a specific version and leads to Android Studio warnings:
dependencies {
compile 'com.github.chrisbanes.photoview:library:+'
}
In my case, the problem was I was declaring jitpack in buildscript.repositories instead of allprojects.repositories in my package build.gradle.
Instead of:
buildscript {
repositories {
...
maven {
url "https://jitpack.io"
}
}
}
It should be here:
allprojects {
repositories {
...
maven {
url "https://jitpack.io"
}
}
}
Rather late but probably your gradle works in offline mode.
Go to File->Settings->Gradle and uncheck the offline mode.
Then try to refresh gradle and it should work
I am behind a corporate firewall. I had my http settings set, but not my https settings. So, I added the following to my gradle.properties file:
systemProp.https.proxyPassword=...
systemProp.https.proxyHost=...
systemProp.https.nonProxyHosts=...
systemProp.https.proxyUser=...
systemProp.https.proxyPort=...
When I added this com.droidninja:filepicker:2.2.5 dependency in my build.gradle (Module Level) file then I got this error.
Failed to resolve: com.droidninja:filepicker:2.2.5
Then I added gradlePluginPortal() in settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
// Add this line
gradlePluginPortal()
}
}
It worked for me.
Top build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
App build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "nl.timmevandermeer.cargoapp"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar']) // <-- use gradle depedencies
compile 'com.android.support:appcompat-v7:22.0.0' // <-- brings in v4
// compile 'com.google.android.gms:play-services:7.0.0' // <-- will cause MultiDex exception, you need to choose which ones you want
// compile 'org.json:json:20141113' // <-- android comes with org.json
}
Multi-Dex Issue:
compile 'com.google.android.gms:play-services:7.0.0' is too big and should not be used directly. Please choose the modules you want here: http://developer.android.com/google/play-services/setup.html
I have similar problem -> ERROR: Failed to resolve:
solved by using maven { url 'https://jitpack.io' } instead of
maven {url 'https://maven.google.com/'}
I have added it in project level build.gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
It works fine.
Tested in UBUNTU - 14.04 ,
>delete .androidstudio1.2 , .gradle , .android , Android studio project from home directory
> Launch using studio.sh
>close the dialogue letting you choose new or old setting , just close it using that "x " button
> then it will set up an virtual nexus 5
>then there will be two errors saying problem about "sdk" and "gradle "
> Caution : choose the appropriate sdk version by clicking on the link given by where the problem is shown .
> close android studio
> reopen android studio
> then you will be thrown a possible error with jdk not found .
>go to file -> project structure
> give the path to jdk , in my case its "usr/local/java/jdk..."
>close android studio and open again , the gradle might work well after this .
In my case I added this to my build.gradle (module:app):
compile 'com.github.glomadrian:velocimeterlibrary:1.1#aar'
However, it gave me an error today. My solution is to use this instead:
compile 'com.github.glomadrian:velocimeterlibrary:+'

Categories

Resources