2016-08-06 7 views
0

メッセージがは、Android Studioの、今私がメッセージ「『コンパイル』プロパティが見つかりませんでした...」私のプロジェクトのGradleのファイルに関連を取得しています

Error:(27, 0) Could not find property 'compile' on org.gradle.api.interna[email protected]64d9a7e6. 
Open File   

でアップグレード私のプロジェクトのために私のbuild.gradleに、私はそれが私に私の依存関係を表示しようとしていると思う。ここでは、そのページには次のようになります。また、

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.example.myname.myappname" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

def var = dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //compile 'com.google.android.gms:play-services:9.2.1' 
    compile 
    'com.android.support:appcompat-v7:24.1.1' compile 
    'com.squareup.okhttp:okhttp:2.7.2' compile 
    'com.jakewharton:butterknife:7.0.1' compile 
    'com.android.support:design:24.1.1' compile 
    'com.android.support:multidex:1.0.1' compile 'com.google.android.gms:play-services:9.4.0' 
    compile 'com.yayandroid:LocationManager:1.1.2' 
    compile 'com.google.android.gms:play-services-ads:9.4.0' 
    compile 'com.google.android.gms:play-services-identity:9.4.0' 
    compile 'com.google.android.gms:play-services-gcm:9.4.0' 
} 

vardef var = dependanciesから)がグレーアウトし、それはこれが関連している場合、私は知りませんが、その上にIマウス「は使用されません割り当て」と言います。私は1年前からバージョンを使用していましたが、私は新しいバージョンで私の他のプロジェクトのいくつかを使用することができます。

答えて

0

def var = dependencies {はナンセンスであるようですが、それは単にdependencies {である必要がありますが、これは間違いなくナンセンスです。

私はあなたの問題が改行にシフトしていると思います。ブロック全体

def var = dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //compile 'com.google.android.gms:play-services:9.2.1' 
    compile 
    'com.android.support:appcompat-v7:24.1.1' compile 
    'com.squareup.okhttp:okhttp:2.7.2' compile 
    'com.jakewharton:butterknife:7.0.1' compile 
    'com.android.support:design:24.1.1' compile 
    'com.android.support:multidex:1.0.1' compile 'com.google.android.gms:play-services:9.4.0' 
    compile 'com.yayandroid:LocationManager:1.1.2' 
    compile 'com.google.android.gms:play-services-ads:9.4.0' 
    compile 'com.google.android.gms:play-services-identity:9.4.0' 
    compile 'com.google.android.gms:play-services-gcm:9.4.0' 
} 

はおそらく

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //compile 'com.google.android.gms:play-services:9.2.1' 
    compile 'com.android.support:appcompat-v7:24.1.1' 
    compile 'com.squareup.okhttp:okhttp:2.7.2' 
    compile 'com.jakewharton:butterknife:7.0.1' 
    compile 'com.android.support:design:24.1.1' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.google.android.gms:play-services:9.4.0' 
    compile 'com.yayandroid:LocationManager:1.1.2' 
    compile 'com.google.android.gms:play-services-ads:9.4.0' 
    compile 'com.google.android.gms:play-services-identity:9.4.0' 
    compile 'com.google.android.gms:play-services-gcm:9.4.0' 
} 

すべきであり、すべてが再び動作するはずです。

+0

ありがとうございます!それで、エラーは修正されましたが、私はプロジェクトのコードにさまざまな問題がありました。どこから来たのか分かりません。幸いにも、私はgithubからプロジェクトを再ダウンロードし、それはうまくいきました。 – Follow

関連する問題