2016-08-20 4 views
1

を構築見つけるに失敗したので、私はすでにここに、改正24.0.1でビルドツールをインストールしている私の端末からの画面のスナップショットです:がすでにビルドツールをインストールしますが、私は問題を得たツールのリビジョンここ24.0.1

build tool on my computer

そして実際に、私はbuild.gradleファイルbuildToolsVersion "24.0.1"でよくそれを書いたと思うが、同期しながら、それはまだこのようなエラーが表示されたプロジェクト:

fail to find build tool revision 24.0.1 install such build tools

はもう一つの問題は、アンドロイドのファイル場所の順序についてですスタジオ。以下はインポートされたプロジェクト階層であり、マニフェストファイルはメインフォルダの下にあり、アンドロイドの観点からは使用ファイルを見つけることができません。

import project hierachy

私は見たことがないようなプロジェクト階層、多分私には、このような答えを発揮できた誰かがそこにあります。ありがとうございました。

アップデート:ここではbuild.gradleファイルの画像あなたは間違った方法でそれをやっている

build.gralde file picture

+0

あなた 'build.gradle'がどのように見えるん方法を示してください。また、この質問は2つの別々の質問に分けることができると思います。 –

+0

ok.build.gradleファイルを – Crabime

答えて

2

です。ファイルには2種類あります。build.gradle最初のものはprojectのもので、moduleのものは2つ以上のものがあります。あなたの場合、両方を混ぜています。

プロジェクトのbuild.gradleは次のようにする必要があります

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

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

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

を、モジュールbuild.gradleはこのようなものになります。あなたの2番目の質問については

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' 
} 
+0

に更新しました。あなたの説明は正しいです。プロジェクト階層に何か間違っているはずです.What build.gradle )appフォルダの下にあり、project perspective.atに現れています。同時に、build.gradleファイルの内容が間違っているとは思わないので、ファイルと私のものを比較してください。違いはありません。 – Crabime

+0

スタンドアロンのsdkマネージャを開き、必要なものがすべてインストールされているかどうかを確認してください。 –

0

を、あなたが見る階層がProjectビューと呼ばれています。

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.

出典:https://developer.android.com/studio/projects/index.html

関連する問題