2

this error causes after moved project from one system to another

I do not about what was happening wrong with my project

  • I've also Clean our project but nothing is happens.
  • I've also removed the dependencies from my libs folder

enter image description here


  • This is my buil.gradle

apply plugin: 'com.android.application'

 android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "com.app.poolblockchain"
    minSdkVersion 15
    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'
    }
}
packagingOptions {
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] 
} }
}

 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:design:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.volley:volley:1.0.0'
compile 'io.jsonwebtoken:jjwt:0.6.0'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile files('src/main/java/libs/httpclient-4.3.6.jar')
compile files('src/main/java/libs/httpcore-4.3.3.jar')
compile files('src/main/java/libs/httpmime-4.3.jar')
compile 'id.zelory:compressor:1.0.4'
 }

enter image description here

piet.t
  • 11,718
  • 21
  • 43
  • 52
Vishal Yadav
  • 1,020
  • 4
  • 15
  • 30

2 Answers2

1

As i know from your description, it is because your $JAVA_HOME is not set. If you are using a Mac:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home

for windows you can refer this video . (Credit goes to its rightful owner)

How to Set Java home variable in Windows

Tejas Pandya
  • 3,987
  • 1
  • 26
  • 51
  • in your android studio , mark your embedded SDK as default File > project structure > sdk location > use embedded JDK . tik this option if not – Tejas Pandya Oct 03 '17 at 06:34
  • please check your directory structure . is it with lib or libs folder structure ? – Tejas Pandya Oct 03 '17 at 06:42
  • Maybe , try right button on lib file in android studio and click "add library" ... – Nikola Lukic Oct 03 '17 at 07:38
  • i am also added by using this `rightclick on lib ->>addAslibrary` but nothing will happen it shows `left Arrrow icon ">"` it means that library is already added in my project – Vishal Yadav Oct 03 '17 at 07:54
0

I have removed this error after long distance covered

  • removing the .gradle folder from the root of the project
  • C:\Users\Administrator\AppData\Local\Android\sdk
  • .gradle
  • invalidate and cache restart
piet.t
  • 11,718
  • 21
  • 43
  • 52
Vishal Yadav
  • 1,020
  • 4
  • 15
  • 30