1
我正在嘗試將Apache Tika放入我的項目中。 但它返回錯誤,不幸的是,我自己無法解決這個問題。如何使用android studio將TIKA添加到build.gradle中?
我怎樣才能把Apache Tika使用android studio?
Error:(27, 0) Gradle DSL method not found: 'runtime()' Possible causes:
The project 'AudioTest' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file The build file may be missing a Gradle plugin. Apply Gradle plugin
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.test.audiotest"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
runtime 'org.apache.tika:tika-parsers:1.13'
}
這是我的build.gradle模塊:應用
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
這是我的build.gradle項目:AudioTest
顯示您的build.gradle文件 –