1

我有一个问题:添加到项目 BoofCV 库时出现以下错误:

Gradle:任务“:myProject:dexDebug”执行失败。无法在任务 ':myProject:dexDebug' 上调用 IncrementalTask​​.taskAction()

毕业——信息

Starting Build
Settings evaluated using settings file 'D:\GitTest\bt-android\settings.gradle'.
Projects loaded. Root project using build file 'D:\GitTest\bt-android\build.gradle'.
Included projects: [root project 'bt-android', project ':myProject']
Evaluating root project 'bt-android' using build file 'D:\GitTest\bt-android\build.gradle'.
Evaluating project ':myProject' using build file 'D:\GitTest\bt-android\myProject\build.gradle'.

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\GitTest\bt-android\myProject\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':myProject'.
Could not create plugin of type 'AppPlugin'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to
get more log output.

BUILD FAILED

Total time: 2.607 secs

gradle --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\GitTest\bt-android\myProject\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':myProject'.
Could not create plugin of type 'AppPlugin'.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:

org.gradle.api.GradleScriptException: A problem occurred evaluating project ':myProject'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR
unnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.
apply(DefaultScriptPluginFactory.java:187)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva
luate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
ifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:470)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:79)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil
dConfigurer.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:128)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:105)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:85)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
troller.run(InProcessBuildActionExecuter.java:81)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:29)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
a:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
meValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
meValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
trap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
ava:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create
 plugin of type 'AppPlugin'.
    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(Defa
ultPluginRegistry.java:67)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(
DefaultPluginContainer.java:109)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInter
nal(DefaultPluginContainer.java:69)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultP
luginContainer.java:35)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.appl
yPlugin(DefaultObjectConfigurationAction.java:117)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.acce
ss$200(DefaultObjectConfigurationAction.java:36)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.ru
n(DefaultObjectConfigurationAction.java:85)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.exec
ute(DefaultObjectConfigurationAction.java:130)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPlu
ginAware.java:41)
    at org.gradle.api.Project$apply$0.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.gro
ovy:34)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at build_boqpn4cnlauug7r5mp8n97uui.run(D:\GitTest\bt-android\myProject\
build.gradle:14)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR
unnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 31 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/Resol
vedModuleVersionResult
    at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groo
vy)
    at com.android.build.gradle.BasePlugin.<init>(BasePlugin.groovy:154)
    at com.android.build.gradle.AppPlugin.<init>(AppPlugin.groovy:75)
    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(D
ependencyInjectingInstantiator.java:48)
    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(Defa
ultPluginRegistry.java:65)
    ... 44 more
 Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.Res
olvedModuleVersionResult
    ... 49 more


BUILD FAILED

Total time: 2.708 secs

和 Build.gradle 文件:

buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }


    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.3'
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'

    }
}
apply plugin: 'android'
apply plugin: 'crashlytics'



repositories {
    mavenCentral()
    maven { url 'http://download.crashlytics.com/maven' }

}

dependencies {
    compile files('libs/achartengine-1.1.0.jar')
    compile files('libs/annotations.jar')
    compile files('libs/TestFlightLib.jar')
    compile files('libs/libGoogleAnalyticsServices.jar')
    compile files('libs/PdfViewer.jar')
    compile files('libs/httpmime-4.2.5.jar')
    compile files('libs/com.radaee.pdfex_view.jar')
    compile files('libs/retrofit-1.4.1.jar')
    compile files('libs/bcprov-jdk15on-1.47.jar')
    compile files('libs/Pubnub-Android-3.5.6.jar')
    compile files('libs/android-viewbadger.jar')

    compile files('libs/nineoldandroids-2.4.0.jar')
    compile "com.android.support:appcompat-v7:18.0.0"
    //compile "com.android.support:support-v4:18.0.0"
    compile "com.j256.ormlite:ormlite-android:+"
    compile "com.squareup:otto:+"
    //compile "com.squareup.okhttp:okhttp:+"
    //compile "com.squareup.retrofit:retrofit:+"
    compile "com.jakewharton:butterknife:4.0.1"
    compile "com.google.code.gson:gson:2.2.+"
    compile "com.squareup.picasso:picasso:2.2.0"
    //compile "org.imgscalr:imgscalr-lib:4.2"
    compile 'com.crashlytics.android:crashlytics:1.+'
    compile 'com.google.android.gms:play-services:4.+'
    compile 'org.twitter4j:twitter4j-core:4.+'

    compile files('libs/BoofCV.jar')
    compile files('libs/BoofCVAndroid.jar')
    compile files('libs/BoofCVXuggler.jar')
    compile files('libs/DDogleg.jar')
    compile files('libs/GeoRegression.jar')
}

android {
    compileSdkVersion 18
    buildToolsVersion "18.0.1"
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }

}

task copyNativeLibs(type: Copy) {
    from(new File('libs')) { include '**' }
    into new File(buildDir, 'native-libs')
}

请帮我解决这个问题

4

0 回答 0