编译并运行穿梭应用程序

时间:2017-09-24 08:59:50

标签: android android-studio gradle compiler-errors dependencies

我想在git上学习并为穿梭应用做出贡献:

https://github.com/timusus/Shuttle

我是经验丰富的开发人员,但我似乎无法编译此存储库。

使用: Android Studio 3.0 beta 6

branch dev

1。我尝试执行gradle sync时出现此错误:

Warning:One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle:
    apply plugin: 'me.tatarka.retrolambda'
To learn more, go to https://d.android.com/r/tools/java-8-support-message.html

Error:Failed to resolve: leakcanary-android

Error:Failed to resolve: recyclerview-fastscroll

2。以我不理解的方式使用依赖项的项目:

   compile libs.cardView
    compile libs.design
    compile libs.palette
    compile libs.prefCompat
    compile libs.prefCompatv14
    compile libs.recyclerView
    compile libs.supportv4
    compile libs.firebaseCore

据我所知,这里的名字是常数但是什么时候能看到那些键的值?

1 个答案:

答案 0 :(得分:0)

默认情况下,Android Studio 3.0 Betas可让您使用Android Gradle Plugin 3.0.0的新alphas / beta版。这些gradle插件支持Java 8功能。 因此,如果您想使用Retrolambda,请从Shuttle/app/build.gradle中删除下一个块:

// Used to enable Java8 features
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

或删除

apply plugin: 'me.tatarka.retrolambda'

如果您想从gradle插件使用Java 8支持。

您可以在dependencies.gradle中找到 leakcanary-android recyclerview-fastscroll 的声明:

ext.versions = [
    ...
    leakCanary  : "1.5.1",
    ...
    fastScroll  : "1.0.15",
    ...
]

ext.libs = [
    ...
    fastScroll : "com.simplecityapps:recyclerview-fastscroll:$versions.fastScroll",
    ...
    leakCanaryDebug : "com.squareup.leakcanary:leakcanary-android:$versions.leakCanary",
    leakCanaryRel : "com.squareup.leakcanary:leakcanary-android-no-op:$versions.leakCanary",
    ...
]