Olk*_*afa 1 android android-studio caldroid
在Android Studio上添加Caldroid库时遇到问题.我尝试了许多不同的添加方法,但它不起作用.我使用的是Android Studio 0.8.2.
libraries.caldroid在/libraries./libraries夹中.settings.gradle
include ':app'
include 'libraries:caldroid:library'
Run Code Online (Sandbox Code Playgroud)
的build.gradle
dependencies {
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services:4.0.30'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':libraries:caldroid:library')
}
Run Code Online (Sandbox Code Playgroud)
但我得到这个错误:
Error:Configuration with name 'default' not found.
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
我迟到但我遇到了类似的问题,所以我想我会分享我是如何解决它的.
要将外部库导入Android Studio,我遵循以下约定:
libs在app目录中创建文件夹.然后将所需的库文件复制到该libs文件夹.例如,我的文件夹包含actionbarsherlock和caldroid文件夹.build.gradle文件中看到它(另外,确保gradle文件具有正确的SDK版本).下载hirondelle-date4j-1.5.1-sources.jar.libs文件夹app/libs/caldroid/.复制hirondelle-date4j-1.5.1-sources.jar到app/libs/caldroid/libs/.您可能还需要复制android-support-v4.jar的-User_Home-/Android/Sdk/extras/android/support/v4/到app/libs/caldroid/libs/.app/libs/caldroid/build.gradle并替换compile 'com.darwinsys:hirondelle-date4j:1.5.1'为compile files('libs/hirondelle-date4j-1.5.1-sources.jar').settings.gradle并添加此行include ':app:libs:caldroid'.接下来,打开" build.gradle(模块:应用程序)",并加入这一行compile project(':app:libs:caldroid')在dependencies.就是这样,现在让gradle"同步"或清理并构建你的项目.
| 归档时间: |
|
| 查看次数: |
3874 次 |
| 最近记录: |