android - 编译并运行航天飞机应用程序

标签 android android-studio gradle compiler-errors dependencies

我想学习并为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

我知道这里的名称是常量,但是什么时候可以看到这些键的值?

最佳答案

默认情况下,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支持。

您可以在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",
    ...
]

关于android - 编译并运行航天飞机应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46388375/

相关文章:

android - 我可以更改直播Android应用的广告单元ID吗?

android - 如何在屏幕关闭或打开另一个应用程序时保持应用程序运行?

android - 无法在 Android Studio 2.1.1 中运行 Android 模拟器

Windows 中的 .gradle 文件夹中缺少 gradle.properties 文件

gradle - Gradle变量初始化

android - 我如何在我的Android cocos2d项目中使用mp3声音,以免将apk的大小增加到25MB

android - 在 Gradle 中的每个构建之前运行单元测试

android - 你如何获得本地时间并且在时间变化时不更新它?

android-studio - Android Studio 在首选项中添加 flutter sdk 路径

java - 将 gradle 子项目链接到任务