android.support.v4 库出错
Error with android.support.v4 library
我正在尝试在我的项目中使用 Android Skype SDK sample code,但我收到大量错误提示 android.support.v4 not found
。
android-support-v4.jar
文件已经在我的 libs
文件夹中。
我关注了其他文章并尝试删除并再次添加但没有成功。有人可以帮我吗?
我的gradle文件
apply plugin: 'com.android.application'
def ROOTDIR = file("..").absolutePath
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "it.moondroid.chatbot"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
jackOptions {
// enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
debug {
minifyEnabled false
debuggable true
jniDebuggable true
}
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/MSFTSIG.RSA'
exclude 'META-INF/BCKEY.DSA'
exclude 'META-INF/BCKEY.SF'
exclude 'META-INF/MSFTSIG.SF'
}
dexOptions {
preDexLibraries=false
jumboMode = true
javaMaxHeapSize "4g"
}
}
configurations {
all*. exclude group: 'com.android.support', module: 'support-v4'
all*. exclude group: 'com.android.support', module: 'support-annotations'
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile files('libs/sanmoku-0.0.5.jar')
compile files('libs/joda-time-2.1.jar')
compile(name: "libucmp", ext: 'aar')
compile(name: "platform", ext: 'aar')
compile(name: "injector", ext: 'aar')
compile(name: "SkypeForBusiness", ext: 'aar')
compile(name: "ucmp-enums", ext: 'aar')
compile(name: "TelemetryClient2", ext: 'aar')
compile(name: "TelemetryService", ext: 'aar')
compile(name: "android-database-sqlcipher", ext: 'aar')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
}
错误:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preDexOptionsBuild UP-TO-DATE
:app:prePackagingOptionsBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareAndroidDatabaseSqlcipherLibrary UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareInjectorLibrary UP-TO-DATE
:app:prepareLibucmpLibrary UP-TO-DATE
:app:preparePlatformLibrary UP-TO-DATE
:app:prepareSkypeForBusinessLibrary UP-TO-DATE
:app:prepareTelemetryClient2Library UP-TO-DATE
:app:prepareTelemetryServiceLibrary UP-TO-DATE
:app:prepareUcmpEnumsLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ConversationsActivity.java
Error:(26, 8) error: cannot access SupportParentable
class file for android.support.v4.app.TaskStackBuilder$SupportParentable not found
Error:(271, 13) error: cannot access DrawerLayout
class file for android.support.v4.widget.DrawerLayout not found
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatAdapter.java
Error:(27, 8) error: cannot access NestedScrollingChild
class file for android.support.v4.view.NestedScrollingChild not found
Error:(27, 55) error: type argument ChatItemPresenter is not within bounds of type-variable VH
where VH is a type-variable:
VH extends ViewHolder declared in class Adapter
Error:(42, 9) error: cannot find symbol variable this
Error:(43, 9) error: cannot find symbol variable this
Error:(44, 9) error: cannot find symbol variable this
Error:(44, 58) error: cannot find symbol variable this
Error:(45, 13) error: package this does not exist
Error:(64, 5) error: method does not override or implement a method from a supertype
Error:(70, 48) error: cannot find symbol variable this
Error:(82, 5) error: method does not override or implement a method from a supertype
Error:(94, 53) error: package this does not exist
Error:(146, 9) error: cannot find symbol variable this
Error:(154, 5) error: method does not override or implement a method from a supertype
Error:(156, 20) error: package this does not exist
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatItemPresenter.java
Error:(20, 8) error: cannot access ScrollingView
class file for android.support.v4.view.ScrollingView not found
Error:(33, 9) error: cannot find symbol variable this
Error:(34, 9) error: cannot find symbol variable this
Error:(35, 9) error: cannot find symbol variable this
Error:(35, 39) error: an enclosing instance that contains ChatItemPresenter.ChatItemPropertyChangeListener is required
Error:(35, 74) error: cannot find symbol variable this
Error:(39, 16) error: cannot find symbol variable this
Error:(47, 56) error: package this does not exist
Error:(57, 52) error: package this does not exist
Error:(62, 60) error: package this does not exist
Error:(72, 16) error: cannot find symbol variable this
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatFragment.java
Error:(98, 37) error: incompatible types: ChatAdapter cannot be converted to Adapter
:app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Information:Total time: 4.785 secs
Information:29 errors
Information:0 warnings
Information:See complete output in console
i'm getting loads of errors saying android.support.v4 not found.
看起来你排除了编译它。
configurations {
all*. exclude group: 'com.android.support', module: 'support-v4'
all*. exclude group: 'com.android.support', module: 'support-annotations'
}
尝试删除该块。
The android-support-v4.jar file is already in my libs folder
您不需要 jar 文件,这些行(是的,全部三行)每行都包含 support-v4 库。
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.0.1'
不过,实际上,您只需要 design
一个。您可以删除其他两个。如果保留它们,则必须使版本号相同。
还有一件事 - 当你有 compile fileTree(dir: 'libs', include: ['*.jar'])
时,你不需要使用任何包含 compile files('libs/blah.jar')
的行,因为第一种方法已经获取了 所有 jar 文件.
我正在尝试在我的项目中使用 Android Skype SDK sample code,但我收到大量错误提示 android.support.v4 not found
。
android-support-v4.jar
文件已经在我的 libs
文件夹中。
我关注了其他文章并尝试删除并再次添加但没有成功。有人可以帮我吗?
我的gradle文件
apply plugin: 'com.android.application'
def ROOTDIR = file("..").absolutePath
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "it.moondroid.chatbot"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
jackOptions {
// enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
debug {
minifyEnabled false
debuggable true
jniDebuggable true
}
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/MSFTSIG.RSA'
exclude 'META-INF/BCKEY.DSA'
exclude 'META-INF/BCKEY.SF'
exclude 'META-INF/MSFTSIG.SF'
}
dexOptions {
preDexLibraries=false
jumboMode = true
javaMaxHeapSize "4g"
}
}
configurations {
all*. exclude group: 'com.android.support', module: 'support-v4'
all*. exclude group: 'com.android.support', module: 'support-annotations'
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile files('libs/sanmoku-0.0.5.jar')
compile files('libs/joda-time-2.1.jar')
compile(name: "libucmp", ext: 'aar')
compile(name: "platform", ext: 'aar')
compile(name: "injector", ext: 'aar')
compile(name: "SkypeForBusiness", ext: 'aar')
compile(name: "ucmp-enums", ext: 'aar')
compile(name: "TelemetryClient2", ext: 'aar')
compile(name: "TelemetryService", ext: 'aar')
compile(name: "android-database-sqlcipher", ext: 'aar')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
}
错误:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preDexOptionsBuild UP-TO-DATE
:app:prePackagingOptionsBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareAndroidDatabaseSqlcipherLibrary UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareInjectorLibrary UP-TO-DATE
:app:prepareLibucmpLibrary UP-TO-DATE
:app:preparePlatformLibrary UP-TO-DATE
:app:prepareSkypeForBusinessLibrary UP-TO-DATE
:app:prepareTelemetryClient2Library UP-TO-DATE
:app:prepareTelemetryServiceLibrary UP-TO-DATE
:app:prepareUcmpEnumsLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ConversationsActivity.java
Error:(26, 8) error: cannot access SupportParentable
class file for android.support.v4.app.TaskStackBuilder$SupportParentable not found
Error:(271, 13) error: cannot access DrawerLayout
class file for android.support.v4.widget.DrawerLayout not found
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatAdapter.java
Error:(27, 8) error: cannot access NestedScrollingChild
class file for android.support.v4.view.NestedScrollingChild not found
Error:(27, 55) error: type argument ChatItemPresenter is not within bounds of type-variable VH
where VH is a type-variable:
VH extends ViewHolder declared in class Adapter
Error:(42, 9) error: cannot find symbol variable this
Error:(43, 9) error: cannot find symbol variable this
Error:(44, 9) error: cannot find symbol variable this
Error:(44, 58) error: cannot find symbol variable this
Error:(45, 13) error: package this does not exist
Error:(64, 5) error: method does not override or implement a method from a supertype
Error:(70, 48) error: cannot find symbol variable this
Error:(82, 5) error: method does not override or implement a method from a supertype
Error:(94, 53) error: package this does not exist
Error:(146, 9) error: cannot find symbol variable this
Error:(154, 5) error: method does not override or implement a method from a supertype
Error:(156, 20) error: package this does not exist
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatItemPresenter.java
Error:(20, 8) error: cannot access ScrollingView
class file for android.support.v4.view.ScrollingView not found
Error:(33, 9) error: cannot find symbol variable this
Error:(34, 9) error: cannot find symbol variable this
Error:(35, 9) error: cannot find symbol variable this
Error:(35, 39) error: an enclosing instance that contains ChatItemPresenter.ChatItemPropertyChangeListener is required
Error:(35, 74) error: cannot find symbol variable this
Error:(39, 16) error: cannot find symbol variable this
Error:(47, 56) error: package this does not exist
Error:(57, 52) error: package this does not exist
Error:(62, 60) error: package this does not exist
Error:(72, 16) error: cannot find symbol variable this
/Users/Anish/Desktop/BTBank/app/src/main/java/it/moondroid/chatbot/ChatFragment.java
Error:(98, 37) error: incompatible types: ChatAdapter cannot be converted to Adapter
:app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Information:Total time: 4.785 secs
Information:29 errors
Information:0 warnings
Information:See complete output in console
i'm getting loads of errors saying android.support.v4 not found.
看起来你排除了编译它。
configurations {
all*. exclude group: 'com.android.support', module: 'support-v4'
all*. exclude group: 'com.android.support', module: 'support-annotations'
}
尝试删除该块。
The android-support-v4.jar file is already in my libs folder
您不需要 jar 文件,这些行(是的,全部三行)每行都包含 support-v4 库。
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.0.1'
不过,实际上,您只需要 design
一个。您可以删除其他两个。如果保留它们,则必须使版本号相同。
还有一件事 - 当你有 compile fileTree(dir: 'libs', include: ['*.jar'])
时,你不需要使用任何包含 compile files('libs/blah.jar')
的行,因为第一种方法已经获取了 所有 jar 文件.