InfoWindowAdapter使用或覆盖不推荐使用的API

时间:2018-11-16 18:35:45

标签: java android android-gradle

这是该问题的后续回答,没有答案。因此,我尝试自行修复该问题,并将该类剥离到最低限度,即实现GoogleMap.InfoWindowAdapter所需的存根。

这是代码

package com.example.michalwolowiec.meetup;

import android.view.View;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;

public class MeetUpInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
    @Override
    public View getInfoWindow(Marker marker) {
        return null;
    }

    @Override
    public View getInfoContents(Marker marker) {
        return null;
    }
}

在构建项目时,我仍然会遇到运行时异常...我得到了堆栈,但没有代码链接到我的代码,这是错误(如果有人有足够的自虐能力,可以全部读取)。我失去了所有希望,请帮助我。 我正在做一个学校项目。

  

org.gradle.api.tasks.TaskExecutionException:任务执行失败   ':app:transformClassesWithDexBuilderForDebug'。在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)     在   org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)     在   org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)     在   org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)     在   org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)     在   org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)     在   org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)     在   org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)     在   org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)     在   org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)     在   org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)     在   org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)     在   org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)     在   org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker $ 1.run(DefaultTaskGraphExecuter.java:256)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)     在   org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)     在   org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)     在   org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)     在   org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.access $ 200(DefaultTaskPlanExecutor.java:79)     在   org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:104)     在   org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:98)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)     在   org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)     在   org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)     在   org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在   java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在   org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)     在java.lang.Thread.run(Thread.java:745)造成原因:   java.lang.RuntimeException:   com.android.build.api.transform.TransformException:   java.lang.RuntimeException:java.lang.RuntimeException在   com.android.builder.profile.Recorder $ Block.handleException(Recorder.java:55)     在   com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)     在   com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)在   org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)在   org.gradle.api.internal.project.taskfactory.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:50)     在   org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)     在   org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:124)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)     在   org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)     ... 33更多原因:   com.android.build.api.transform.TransformException:   java.lang.RuntimeException:java.lang.RuntimeException在   com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:427)     在   com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:239)     在   com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:235)     在   com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)     ... 49更多原因:java.lang.RuntimeException:   java.lang.RuntimeException在   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)     在   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     在java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在   java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)     在   java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)     在java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)在   com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)     在   com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.getInitalGraphData(DesugarIncrementalTransformHelper.java:162)     在   com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.makeDesugaringGraph(DesugarIncrementalTransformHelper.java:130)     在   com.google.common.base.Suppliers $ NonSerializableMemoizingSupplier.get(Suppliers.java:160)     在   com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.getDependenciesPaths(DesugarIncrementalTransformHelper.java:231)     在   com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.getD8DesugaringCacheInfo(DexArchiveBuilderTransform.java:461)     在   com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:375)     ... 52更多原因:java.lang.RuntimeException   org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:148)在   org.objectweb.asm.ClassReader.readModule(ClassReader.java:731)在   org.objectweb.asm.ClassReader.accept(ClassReader.java:632)在   org.objectweb.asm.ClassReader.accept(ClassReader.java:500)在   com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:144)     在   com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:92)     在   com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:63)     在   com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.lambda $ getInitalGraphData $ 4(DesugarIncrementalTransformHelper.java:150)     在   java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1424)     在java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)     在   java.util.concurrent.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1056)     在   java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)     在   java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Scooby小吃可以帮助我。

上帝帮助我们所有人...

0 个答案:

没有答案