我不明白为什么会有这个错误。我在另一台计算机上编译,发行版编译进行得很好,但在这台计算机上,我得到:
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:app:preBuild
:app:preReleaseBuild
:app:checkReleaseManifest
:app:preDebugBuild
:app:prepareComAndroidSupportAppcompatV71910Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices4323Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:mergeReleaseAssets
:app:processReleaseManifest
:app:crashlyticsCleanupResourcesRelease
:app:crashlyticsUploadStoredDeobsRelease
:app:crashlyticsGenerateResourcesRelease
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseResources
:app:generateReleaseSources
:app:compileReleaseJava
/Users/wimha/wimhaAndroidApp/app/src/main/java/com/google/zxing/client/android/camera/AutoFocusManager.java:63: error: method executeOnExecutor in class AsyncTask<Params,Progress,Result> cannot be applied to given types;
outstandingTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
^
required: Executor,CAP#1[]
found: Executor
reason: formal varargs element type CAP#1 is not accessible from class AutoFocusManager
where Params,Progress,Result are type-variables:
Params extends Object declared in class AsyncTask
Progress extends Object declared in class AsyncTask
Result extends Object declared in class AsyncTask
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
/Users/wimha/wimhaAndroidApp/app/src/main/java/com/google/zxing/client/android/InactivityTimer.java:52: error: method executeOnExecutor in class AsyncTask<Params,Progress,Result> cannot be applied to given types;
inactivityTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
^
required: Executor,CAP#1[]
found: Executor
reason: formal varargs element type CAP#1 is not accessible from class InactivityTimer
where Params,Progress,Result are type-variables:
Params extends Object declared in class AsyncTask
Progress extends Object declared in class AsyncTask
Result extends Object declared in class AsyncTask
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
/Users/wimha/wimhaAndroidApp/app/src/main/java/com/google/zxing/client/android/share/AppPickerActivity.java:35: error: method executeOnExecutor in class AsyncTask<Params,Progress,Result> cannot be applied to given types;
backgroundTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
^
required: Executor,CAP#1[]
found: Executor
reason: formal varargs element type CAP#1 is not accessible from class AppPickerActivity
where Params,Progress,Result are type-variables:
Params extends Object declared in class AsyncTask
Progress extends Object declared in class AsyncTask
Result extends Object declared in class AsyncTask
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
3 errors
:app:compileReleaseJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 56.213 secs知道吗?
发布于 2014-08-05 11:51:48
您不需要卸载Java8,只要打开“项目结构”(Ctrl+alt+shift+s),选择“select”并将"JDK“设置为path,就可以使用JDK 7。
发布于 2014-06-26 08:31:22
卸载Java 8解决了这个问题。
如何卸载JDK 1.8
发布于 2014-06-19 22:31:56
我用这样的匿名声明来解决问题
private AsyncTask<?, ?, ?> outstaindingTask;与实际类型:
private AsyncTask<Object, Object, Object> outstandingTask;您可以通过查看实例化的类定义找到要使用的类型列表,例如,在AutoFocusManager的情况下
outstandingTask = new AutoFocusTask();AutoFocusTask类声明为:
private final class AutoFocusTask extends AsyncTask<Object,Object,Object>https://stackoverflow.com/questions/24314842
复制相似问题