我正试图让BarcodeEye在我自己的项目中工作。 当我在eclipse中导入项目并尝试运行它时,它工作得很好。
然后我尝试了以下3种方式在android studio中获取它。
有没有人知道这里出了什么问题?
C:\Users\xx\xx\BarcodeEye\src\com\google\zxing\client\android\camera\AutoFocusManager.java:59: 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 ?
C:\Users\xx\xx\BarcodeEye\src\com\github\barcodeeye\migrated\InactivityTimer.java:50: 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 ?
C:\Users\xx\xx\BarcodeEye\src\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 ?
Note: C:\Users\xx\xx\BarcodeEye\src\com\github\barcodeeye\scan\api\CardPresenter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
答案 0 :(得分:2)
好好仔细看看AsyncTasks
他们自己后,我发现了错误的来源。
显然,在将项目转换为android studio时,它并没有采用asyncTask
看起来像这样
AsyncTask<?, ?, ?> someTask;
然后我接着改变了所有的AsyncTask来保存适当的功能。
因此,如果其他人遇到此问题,请检查您的AsyncTask标识符,这是导致问题的原因