【问题标题】:Compile and run shuttle application编译并运行穿梭应用程序
【发布时间】:2018-03-05 10:18:40
【问题描述】:

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

https://github.com/timusus/Shuttle

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

使用: Android Studio 3.0 beta 6

分支开发

1 .当我尝试进行 gradle 同步时收到此错误:

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) Don't use beta 3。尽快升级。 2)你需要 Java 8(意味着已经安装了它) 3)将 retrolambda 添加到你的依赖项中,看看它是否有效
  • 谢谢,我正在使用我想念的 beta6。retrolambda 已经存在于一些库中。我想我支持 java 8

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


【解决方案1】:

默认情况下,Android Studio 3.0 Beta 允许您使用 Android Gradle Plugin 3.0.0 的新 alpha/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 支持。

leakcanary-androidrecyclerview-fastscroll的声明可以在dependencies.gradle找到: p>

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",
    ...
]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多