问题描述
对于初学者和我一样,谁能告诉我如何使用 HTTPS刚刚创建示例演示应用程序:// github.com/umano/AndroidSlidingUpPanel ,在Android的工作室版0.8.6。
For a complete beginner like me, can anyone tell me how to just create sample demo application using "https://github.com/umano/AndroidSlidingUpPanel" in Android Studio version "0.8.6".
我已经遵循了以包括Android的滑动面板库,这些提到的步骤1)从以下位置 https://github.com/umano/AndroidSlidingUpPanel/releases下载最新的稳定版本
I have followed these mentioned steps in order to include the Android Sliding panel library1) Download the latest stable release from the following location"https://github.com/umano/AndroidSlidingUpPanel/releases"
2)解压缩zip文件夹
2)extract the zip folder
从你管的视频 https://www.youtube.com/watch?v= 1MyBO9z7ojk
3)中创建了一个名为库的根目录文件夹(应用程序名称为slidingPanelTesting2)
3)Created a folder in the root directory with name "libraries" (application name is "slidingPanelTesting2")
4)复制解压目录中的文件夹库
4)Copied the extracted directory in to the folder libraries
5)在settings.gradle的code中的第一行更改为
5) In the settings.gradle changed the first line of code to
包括:应用程序',':库:AndroidSlidingUpPanel:AndroidSlidingUpPanel-2.0.1
6)在poject结构(文件 - > projectstructure) 点击应用程序的模块部分,在相关性选项卡中添加模块依赖
6)In the poject structure (file->projectstructure) click on "app" of modules section, In Dependencies tab added the module Dependency
libraries:AndroidSlidingUpPanel:AndroidSlidingUpPanel-2.0.1
7)点击应用后,我收到以下错误 错误:配置名称为默认找不到
7)After clicking Apply I get the following error Error:Configuration with name 'default' not found.
这将是巨大的,如果有人能回答,因为我有很多帖子同样的问题没有任何答案
It would be great if some one can answer as I have many posts with the same problem without any answers
推荐答案
这是很容易这个库添加到你的Android Studio项目。首先,取消所有的previous步骤 - 他们根本没有必要
It's much easier to add this library to your Android Studio project. First of all undo all of your previous steps - they're simply not needed.
打开应用
文件夹 build.gradle
文件和下面的几行添加到依赖关系:
Open the build.gradle
file of your app
folder and add the following lines to the dependencies:
dependencies {
repositories {
mavenCentral()
}
compile 'com.sothree.slidinguppanel:library:+'
}
完成! Android的工作室可能会抱怨说,仓库的东西不属于那里所以只是将其移动到项目本身,而不是应用程序模块的build.gradle文件。
Done! Android Studio may complain that the repositories stuff doesn't belong there so just move it to the build.gradle file of the project itself instead of the app module.
这是你的build.gradle文件应该是什么样子到底:
Here's how your build.gradle files should look like in the end:
由于斯科特·巴塔
在评论中提到的,mavenCentral(),如果有已经在您的资料库列表jcenter()是不需要的。 jcenter()好像mavenCentral()的超集 - 在这里阅读更多:SO: Android的buildscript库。 jcenter VS mavencentral
As Scott Barta
mentioned in the comments, mavenCentral() isn't needed if there's already jcenter() in your repository list. jcenter() seems like a superset of mavenCentral() - Read more here: SO: Android buildscript repositories. jcenter VS mavencentral
这篇关于如何使样品演示项目与Android滑动面板的Android Stuido的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!