所以我嘗試使用actionbarsherlock和viewpagerindicator,出於某種原因,viewpagerindicator庫由於某種原因無法導入。任何人有任何想法?Gradle - 無法在Android Studio中使用gradle依賴項導入viewpagerindicator
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:[email protected]'
compile 'com.viewpagerindicator:library:2.4.0'
}
dependencies {
compile project(':libraries:facebook')
}
此導入錯誤出「無法解析符號viewpageindicator
import com.viewpagerindicator.TabPageIndicator;
這是我的 「消息搖籃任務」
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\android-sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\android-sdk\platforms\android-19\android.jar -M C:\myAppName\app\build\manifests\debug\AndroidManifest.xml -S C:\myAppName\app\build\res\all\debug -A C:\myAppName\app\build\assets\debug -m -J C:\myAppName\app\build\source\r\debug -F C:\myAppName\app\build\libs\app-debug.ap_ --debug-mode --custom-package com.myAppName.app --output-text-symbols C:\myAppName\app\build\symbols\debug
Error Code:
1
Output:
C:\myAppName\app\build\res\all\debug\values\values.xml:911: error: Error: No resource found that matches the given name: attr 'vpiTabPageIndicatorStyle'.
C:\myAppName\app\build\res\all\debug\values\values.xml:914: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.TabPageIndicator'.
C:\myAppName\app\build\res\all\debug\values\values.xml:934: error: Error: No resource found that matches the given name: attr 'fadeDelay'.
C:\myAppName\app\build\res\all\debug\values\values.xml:933: error: Error: No resource found that matches the given name: attr 'fadeLength'.
C:\myAppName\app\build\res\all\debug\values\values.xml:931: error: Error: No resource found that matches the given name: attr 'selectedColor'.
C:\myAppName\app\src\main\res\values\styles.xml
No resource found that matches the given name: attr 'vpiTabPageIndicatorStyle'.
Error retrieving parent for item: No resource found that matches the given name 'Widget.TabPageIndicator'.
No resource found that matches the given name: attr 'fadeDelay'.
No resource found that matches the given name: attr 'fadeLength'.
No resource found that matches the given name: attr 'selectedColor'.
什麼版本的Android Studio?你是什麼意思「不進口」? –
@ScottBarta,我只是用確切的錯誤更新了我的問題。 –