Crabime
Crabime

Reputation: 684

Having already installed build-tools but fail to find build tools revision 24.0.1

Here i got a problem, I have already installed build tool in revision 24.0.1, here is the screen snapshot from my terminal:

build tool on my computer

And in fact I think I wrote it well in the build.gradle filebuildToolsVersion "24.0.1", but while sync the project it still appear such error:

fail to find build tool revision 24.0.1 install such build tools

Another question is about the file place order in android studio. Below is the imported project hierarchy and the manifest file is under the main folder and i can not find any usage file under android perspective.

import project hierachy

Such a project hierarchy I have never seen, maybe there is somebody who could demonstrate such answer to me. Thank you.

Update: Here is the build.gradle file picture

build.gralde file picture

Upvotes: 1

Views: 313

Answers (2)

Leszek Jasek
Leszek Jasek

Reputation: 2356

Regarding your second question, the hierarchy you see is called Project view.

enter image description here

By default, Android Studio displays your project files in the Android view. This view does not reflect the actual file hierarchy on disk, but is organized by modules and file types to simplify navigation between key source files of your project, hiding certain files or directories that are not commonly used. (...) To see the actual file structure of the project including all files hidden from the Android view, select Project from the dropdown at the top of the Project window.

Source: https://developer.android.com/studio/projects/index.html

Upvotes: 0

Nongthonbam Tonthoi
Nongthonbam Tonthoi

Reputation: 12963

You are doing it in the wrong way. There are two types of build.gradle files. The first one is for your project and the second type for module which can be more than one. In your case you are mixing both.

The project's build.gradle should like this:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and the module build.gradle should look something like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.something"
        minSdkVersion 14
        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.1.1'
    compile 'com.android.support:support-v4:24.1.1'
    compile 'com.android.support:design:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'
    compile 'com.android.support:recyclerview-v7:24.1.1'
}

Upvotes: 2

Related Questions