2017-11-09 1 views
1

Androidスタジオ3をゼロからインストールし、Androidスタジオ3を使用していないプロジェクトをクローンするだけです。コンパイルしようとしましたが、gradleが正しく同期できませんでした。Androidスタジオ3.0のアップデート、エラー同期のグレード

私はgradle 4.3を使用しています。他の投稿で問題を検索していますが、修正方法が見つからないためです。

buildscript { 
    repositories { 
     jcenter() 
     mavenCentral() 
     google() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
     classpath "io.realm:realm-gradle-plugin:2.1.1" 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     mavenCentral() 
     maven { url "https://maven.google.com" } 
    } 
} 

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

アプリ/ Gradleのファイル:これは私のGradleファイルです

apply plugin: 'com.android.application' 
apply plugin: 'realm-android' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 

    lintOptions { 
     disable 'InnerclassSeparator' 
    } 

    defaultConfig { 
     applicationId "fr.laway.dev.laway" 
     minSdkVersion 21 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile project(path: ':laway_data', configuration: 'default') 
    compile 'uk.co.chrisjenx:calligraphy:2.2.0' 
    compile 'com.android.support:appcompat-v7:26.1.0' 
    compile 'com.android.support:design:26.1.0' 
    compile 'com.android.support:recyclerview-v7:26.1.0' 
    compile 'com.android.support:cardview-v7:26.1.0' 
    compile 'com.google.code.gson:gson:2.8.0' 
    compile 'com.github.clans:fab:1.6.4' 
    compile 'com.aurelhubert:ahbottomnavigation:1.5.1' 
    compile 'com.android.support:support-v4:26.1.0' 
    compile 'com.squareup.retrofit2:retrofit:2.1.0' 
    compile 'com.android.support:multidex:1.0.2' 
    compile 'com.facebook.android:facebook-android-sdk:4.27.0' 
    compile 'com.google.android.gms:play-services-auth:11.4.2' 
    compile 'com.google.gms:google-services:3.1.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
} 

最後に、私のエラー:

enter image description here

が私のGradleファイルに欠けている何かはありますか?エラーから

答えて

1

それが関連している理由私は知らないが、私はちょうど私のレルムライブラリを更新:

classpath "io.realm:realm-gradle-plugin:4.1.1" 

これは、すべてのエラーをコンパイルして除去するための仕上げのために十分でした。 Gradleのは、まだ私は申し訳ありませんが、私は私が何をすべきか理解していない私のためのx)

0

、この文句のGradle:

アンドロイド-aptのプラグインは、Androidのプラグインと互換性がありませんが。代わりに 「annotationProcessor」設定を使用してください。 documentationから

プラグインの以前のバージョンで注釈プロセッサ依存構成

を使用することは、コンパイル・クラスパス上の依存関係が自動的にプロセッサのクラスパスに追加されました。つまり、アノテーション・プロセッサをコンパイル・クラスパスに追加すると、期待どおりに動作します。ただし、これにより、プロセッサに多数の不要な依存関係が追加されるため、パフォーマンスに大きな影響が生じます。 Androidのプラグイン3.0.0を使用する場合は下図のように、あなたは、annotationProcessor依存の設定を使用してプロセッサのクラスパスに注釈プロセッサを追加する必要があります

dependencies { 
     ... 
     annotationProcessor 'com.google.dagger:dagger-compiler:<version-number>'  
    } 

あなたのlaway_dataでannotationProcessorを使用する必要がありますモジュールbuild.gradle

+0

非常に神秘的である: '依存関係{ ... annotationProcessor「com.google.dagger:短剣、コンパイラ: <バージョン番号> ' } ' –

関連する問題