9

Android Studio と gradle で CrashLytics を使用しようとしていますが、紛らわしいエラー java.lang.NoSuchMethodError: が表示されます。

私のbuild.gradleは次のとおりです。

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

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

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

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

android {
    buildToolsVersion "18.0.1"
    compileSdkVersion 18

    //...
}


dependencies {
    compile 'com.android.support:appcompat-v7:18.0.+'
    compile 'com.google.android.gms:play-services:3.2.25'

    compile 'com.crashlytics.android:crashlytics:1.+'
    //compile 'com.newrelic.agent.android:android-agent:2.426.0'

}

しようとするとき$ gradle assembleDebug

Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServices3225Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:processDebugManifest UP-TO-DATE
:crashlyticsCleanupResourcesDebug
:crashlyticsUploadStoredDeobsDebug
:crashlyticsGenerateResourcesDebug
:mergeDebugAssets UP-TO-DATE
:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Could not call IncrementalTask.taskAction() on task ':mergeDebugResources'

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

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':mergeDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:283)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:214)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:276)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
    at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:78)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.GradleException: Could not call IncrementalTask.taskAction() on task ':mergeDebugResources'
    at org.gradle.util.JavaMethod.invoke(JavaMethod.java:69)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:527)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:510)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 49 more
Caused by: java.lang.NoSuchMethodError: com.android.sdklib.SdkManager.createManager(Ljava/lang/String;Lcom/android/utils/ILogger;)Lcom/android/sdklib/SdkManager;
    at com.android.builder.DefaultSdkParser.initParser(DefaultSdkParser.java:76)
    at com.android.builder.SdkParser$initParser.call(Unknown Source)
    at com.android.build.gradle.internal.Sdk.loadParser(Sdk.groovy:125)
    at com.android.build.gradle.internal.Sdk$loadParser.call(Unknown Source)
    at com.android.build.gradle.BasePlugin.getLoadedSdkParser(BasePlugin.groovy:295)
    at com.android.build.gradle.BasePlugin.getAndroidBuilder(BasePlugin.groovy:318)
    at com.android.build.gradle.BasePlugin$getAndroidBuilder.call(Unknown Source)
    at com.android.build.gradle.internal.tasks.BaseTask.getBuilder(BaseTask.groovy:29)
    at com.android.build.gradle.tasks.MergeResources_Decorated.getBuilder(Unknown Source)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:158)
    at org.gradle.api.internal.BeanDynamicObject.getProperty(BeanDynamicObject.java:112)
    at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:78)
    at com.android.build.gradle.tasks.MergeResources_Decorated.getProperty(Unknown Source)
    at com.android.build.gradle.tasks.MergeResources.doIncrementalTaskAction(MergeResources.groovy:136)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:107)
    at org.gradle.util.JavaMethod.invoke(JavaMethod.java:62)
    ... 56 more


BUILD FAILED

Total time: 9.297 secs

メソッドが見つからない理由がわかりません。ビルド ツール 18 がまだサポートされていない可能性があります。

4

4 に答える 4

4

「com.android.tools.build:gradle:1.0.0」と「com.crashlytics.tools.gradle:crashlytics-gradle:1.+」を持っているすべての人にとって、これは私にとってうまくいきました:

  • きれいなプロジェクト
  • プロジェクトを作成
  • アプリを実行

編集: これが機能しない場合は、download.crashlytics.com に ping を実行して、それらが稼働しているかどうかを確認してください。そうでない場合は、そうなるまで待ちます。

于 2015-01-14T14:59:28.613 に答える
1

私の場合、プラグインを再インストールすると問題が解決しました。

1) Mac: Android Studio メニューから [設定] を選択します。Windows および Linux: [ファイル] メニューから [設定] を選択します。

2) 設定ダイアログの右側にある「プラグイン」を選択し、プラグインをアンインストールして、android studio を再起動します。

3) プラグインを再インストールし、Android Studio を再起動します。

これが役立つことを願っています。

于 2015-03-20T12:06:20.090 に答える