【问题标题】:Error when implementing expansion panel in Android Studio在 Android Studio 中实现扩展面板时出错
【发布时间】:2018-07-21 09:47:04
【问题描述】:

我想在我的 Android 应用中制作一个扩展面板,但我尝试了很多库,但它们都无法在我的 Android Studio 中同步。

这是我的build.gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'


    compile 'com.android.support:appcompat-v7:25.1.1'

    compile 'com.github.florent37:expansionpanel:1.1.1'
}
apply plugin: 'com.google.gms.google-services'

这就是同步后发生的情况:

错误:无法解决:com.android.support:appcompat-v7:26.1.0 安装存储库并同步项目
打开文件
在项目结构对话框中显示

【问题讨论】:

    标签: java android


    【解决方案1】:

    你应该改变

    编译'com.android.support:appcompat-v7:25.1.1'

    编译'com.android.support:appcompat-v7:27.1.1'

    这是在这里找到的最新可用版本

    https://developer.android.com/topic/libraries/support-library/packages

    【讨论】:

      【解决方案2】:

      将此添加到所有项目中的项目级 gradle -> 存储库

      Add maven { url "https://maven.google.com" }
      

      【讨论】:

      • 感谢它编译成功,但在 xml 中显示布局时出现错误
      • 您可以解决在预览选项中选择应用程序主题的问题。检查预览窗口的顶部。另外,赞成这个答案。
      猜你喜欢
      • 2011-07-07
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      • 2022-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多