我试图向我的应用程序添加一个依赖项,我不小心修改了错误的build.gradle文件,现在我的应用程序不再正确构建.
这是我的错误:
Error:FAILURE: Build Failed with an exception. * What went wrong: Task 'generateDebugSources' not found in project ':app'. * Try: Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我试图实现存在here的代码,但我最终在Android Studio中破坏了东西,因为我是gradle系统的新手.
我编辑的文件是.idea / gradle.xml和build.gradle,我在下面包含:
的build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } }
gradle.xml:
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="GradleSettings"> <option name="linkedExternalProjectsSettings"> <GradleProjectSettings> <option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="modules"> <set> <option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$/app" /> </set> </option> </GradleProjectSettings> </option> </component> </project>
我试图尽可能接近默认文件,但最终使问题变得更糟,我无法再构建我的项目了.
此外,我使用的是Android Studio 1.1.0,它显示为最新更新.
在此先感谢,如果我需要提供更多信息,请告诉我.