0

私はAndroidスタジオでgradleビルドの時間を短縮しようとしていました。エラーを取得します。Android Studio:タスク ' - 'がルートプロジェクト 'プロジェクト名'に見つかりませんでした。ビルドスピードアップ後

Error:FAILURE: Build failed with an exception. 

* What went wrong: 
Task '-' not found in root project '[Project Name]'. 

* 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. 

グーグルの日の後、私は何も見つかりませんでした。誰もがこのエラーを引き起こした可能性があることを知っていますか、今私のプロジェクトをテストすることはできません。

他のすべての質問では、タスク ' - 'が指定されていません。

私は実際のプロジェクト名の "[Project Name]"に補足しました。

// 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:2.1.3' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

そして、私のモジュールはbuild.gradleは次のとおりです:

マイプロジェクトbuild.gradleがある

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23" 

    defaultConfig { 
     applicationId "ca.lakeeffect.scoutingapp" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.0.0' 
} 

そして、私のgradle.properties

# Project-wide Gradle settings. 

# IDE (e.g. Android Studio) users: 
# Gradle settings configured through the IDE *will override* 
# any settings specified in this file. 

# For more details on how to configure your build environment visit 
# http://www.gradle.org/docs/current/userguide/build_environment.html 

# Specifies the JVM arguments used for the daemon process. 
# The setting is particularly useful for tweaking memory settings. 
# Default value: -Xmx10248m -XX:MaxPermSize=256m 
# org.gradle.j# Project-wide Gradle settings. 

# IDE (e.g. Android Studio) users: 
# Settings specified in this file will override any Gradle settings 
# configured through the IDE. 

# For more details on how to configure your build environment visit 
# http://www.gradle.org/docs/current/userguide/build_environment.html 

# The Gradle daemon aims to improve the startup and execution time of Gradle. 
# When set to true the Gradle daemon is to run the build. 
# TODO: disable daemon on CI, since builds should be clean and reliable on servers 
org.gradle.daemon=true 

# Specifies the JVM arguments used for the daemon process. 
# The setting is particularly useful for tweaking memory settings. 
# Default value: -Xmx10248m -XX:MaxPermSize=256m 
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 

# When configured, Gradle will run in incubating parallel mode. 
# This option should only be used with decoupled projects. More details, visit 
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 
org.gradle.parallel=true 

# Enables new incubating mode that makes Gradle selective when configuring projects. 
# Only relevant projects are configured which results in faster builds for large multi-projects. 
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand 
org.gradle.configureondemand=truevmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 

# When configured, Gradle will run in incubating parallel mode. 
# This option should only be used with decoupled projects. More details, visit 
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 
# org.gradle.parallel=true 
+1

あなたのプロジェクトとアプリを 'build.gradle'で表示できますか? –

+0

が追加されました@Alvenir – Ajay

+0

'Invalidate Caches/Restart' Android Studioと' org.gradle.parallel = true'を使わないでプロジェクトを再構築してください –

答えて

0

私が何をすべきかわからなかったので、最後の手段として、私は新しいプロジェクトを作り、自分のコードをコピーしました。私はFile > Restartを押して、数回私のプロジェクトを再構築しました。それはうまくいった!他の誰かが本当に知っている素晴らしい答えを見つけたら。

関連する問題