我想将库项目导入到我的应用程序中,但是每当尝试这样做时,Android Studio都无法识别它
它还给我在build.gradle中的错误。
该库是:PagerSlidingTabStrip...。
这是一些图片:
到目前为止,我一直在尝试使其工作3天!请帮我 :)
编辑:
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:19.0.0'
}
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 8
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
编辑2:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Sahertoday'.
> Could not resolve all dependencies for configuration ':Sahertoday:_debugCompile'.
> Could not find com.astuetz:pagerslidingtabstrip:1.0.1.
Required by:
Saher-3:Sahertoday:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
首先,您可以将此依赖项添加到您的项目中,而无需在本地编译该库。
dependencies {
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
否则,如果您想在本地编译此库,则必须在根目录的gradle.properties中定义这些键。
ANDROID_BUILD_TARGET_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=19
ANDROID_BUILD_SDK_VERSION=19
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句