Build Gradle项目失败

时间:2017-05-18 15:27:17

标签: java android android-gradle gradlew butterknife

我想构建这个项目:https://github.com/cziberez/AlwaysOnDisplayAmoled,但是我收到了这个错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformJackWithJackForDebug'.
> com.android.build.api.transform.TransformException: com.android.jack.api.v01.CompilationException: Failed to compile

更多详情:

:app:transformJackWithJackForDebug
file or directory 'C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\debug\java', not found
file or directory 'C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\debug\java', not found
Executing task ':app:transformJackWithJackForDebug' (up-to-date check took 0.063 secs) due to:
  No history is available.
All input files are considered out-of-date for incremental task ':app:transformJackWithJackForDebug'.
file or directory 'C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\debug\java', not found
Jack sanity checks disabled
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:7: The type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:17: The type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:25: The type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:25: The method open() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:26: The type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:26: The type Camera.Parameters is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:26: The method getParameters() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:27: The method setFlashMode(String) from the type Camera.Parameters is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:27: The type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:27: The type Camera.Parameters is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:27: The field Camera.Parameters.FLASH_MODE_TORCH is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:28: The method setParameters(Camera.Parameters) from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:31: The method setPreviewTexture(SurfaceTexture) from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:46: The method startPreview() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:51: The method stopPreview() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:66: The method stopPreview() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Flashlight.java:67: The method release() from the type Camera is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\views\Clock.java:55: The field Configuration.locale is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\services\StarterService.java:177: The method isScreenOn() from the type PowerManager is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\SamsungHomeWatcherActivity.java:10: The import android.view.Window is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\parcelables\parcelableNotifications.java:8: The serializable class parcelableNotifications does not declare a static final serialVersionUID field of type long
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\services\WidgetUpdater.java:36: The method getColor(int) from the type Resources is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\services\WidgetUpdater.java:39: The method getColor(int) from the type Resources is deprecated
ERROR: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\Constants.java:14: AlarmClock cannot be resolved to a variable
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\Picker.java:44: The method getDrawable(int) from the type Resources is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\Intro.java:118: The method getColor(int) from the type Resources is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\Intro.java:221: The method getColor(int) from the type Resources is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\Intro.java:299: The method forceBool(String, boolean) from the type Prefs is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\Intro.java:310: The method forceBool(String, boolean) from the type Prefs is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\views\SeekBarPreference.java:65: The field ViewGroup.LayoutParams.FILL_PARENT is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\views\SeekBarPreference.java:71: The field ViewGroup.LayoutParams.FILL_PARENT is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\receivers\ScreenReceiver.java:36: The field PowerManager.SCREEN_BRIGHT_WAKE_LOCK is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\receivers\ScreenReceiver.java:51: The field Settings.Secure.LOCK_PATTERN_ENABLED is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\build\generated\source\aidl\debug\com\android\vending\billing\IInAppBillingService.java:160: The method getInterfaceDescriptor() from the type IInAppBillingService.Stub.Proxy is never used locally
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\receivers\ChargeChangeReceiver.java:60: The method isScreenOn() from the type PowerManager is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\SettingsFragment.java:520: The method temporaryUnusedFunctionToSetAppToOpen() from the type SettingsFragment is never used locally
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\CurrentAppResolver.java:65: The method getRunningTasks(int) from the type ActivityManager is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\Prefs.java:6: The import android.widget.Toast is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\TTS.java:35: The method speak(String, int, HashMap<String,String>) from the type TextToSpeech is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\TTS.java:46: The method speak(String, int, HashMap<String,String>) from the type TextToSpeech is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\TTS.java:58: The method speak(String, int, HashMap<String,String>) from the type TextToSpeech is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\TTS.java:60: The method speak(String, int, HashMap<String,String>) from the type TextToSpeech is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\TTS.java:61: The method speak(String, int, HashMap<String,String>) from the type TextToSpeech is deprecated
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\activities\DonateActivity.java:66: The serializable class  does not declare a static final serialVersionUID field of type long
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\BrightnessManager.java:4: The import android.preference.PreferenceActivity is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\BrightnessManager.java:6: The import android.support.v7.app.AppCompatActivity is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\helpers\BrightnessManager.java:8: The import com.tomer.alwayson.activities.PreferencesActivity is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\services\NotificationListener.java:19: The import java.util.Map is never used
WARNING: C:\Users\MY_USER_NAME\Downloads\AlwaysOnDisplayAmoled-master (3)\AlwaysOnDisplayAmoled-master\app\src\main\java\com\tomer\alwayson\services\NotificationListener.java:77: The field Notification.icon is deprecated

com.android.jack.api.v01.CompilationException: Failed to compile
        at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:109)
        at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1816)
        at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1643)
        at com.android.build.gradle.internal.transforms.JackTransform.runJack(JackTransform.java:221)
        at com.android.build.gradle.internal.transforms.JackTransform.transform(JackTransform.java:195)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:158)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:129)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:118)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        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:52)
        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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.jack.frontend.FrontendCompilationException: Failed to compile
        at com.android.jack.Jack.buildSession(Jack.java:978)
        at com.android.jack.Jack.run(Jack.java:496)
        at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:102)
        ... 35 more
:app:transformJackWithJackForDebug FAILED
:app:transformJackWithJackForDebug (Thread[Task worker,5,main]) completed. Took 2.715 secs.

gradle.properties

org.gradle.daemon=true

org.gradle.parallel=true

org.gradle.jvmargs=-Xmx4G

我还在build.gradle文件中声明了堆大小。

dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "4g"
}

问题出在哪里?

0 个答案:

没有答案