I have an error when importing an Android project to another computer. I've been working on this project for almost a month and it hasn't given me any problems, but I had to change my computer. After installing Android Studio on the new computer and importing the project, I get the following error messages:
The code of my file app/build.gradle
is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.tigestion.guillermo.agendagui"
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'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
}
And the general code build.gradle
:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have looked at tutorials both on youtube and in this forum, in Spanish and English, and no solution works for me. It doesn't help me to comment out the testCompile line, it doesn't help me to add:
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter { url "http://jcenter.bintray.com/" }
}
It is useless for me to download a junit 4-12.jar file and manually add it to the project structure by deleting the previous junit and I don't know what else to do because basically those are all the solutions I have found.
Both Android configurations (Both the old computer and the new one) are the ones that the installation leaves by default. The operating system in the old one was Windows 7 and in the new Windows 8.
Please help.
I have it configured like this:
a).
build.gradle
(the one outside the folders)In that same file:
b).
build.gradle
inside the folderapp
I put only what is related to JUnit... do not change the rest.
Have you tried going to Build->clean build and when finished processing Build->Rebuild ?
Sometimes Android Studio hangs due to any temporary file created or due to various unexplained issues...