Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 找不到方法包()_Android_Gradle_Android App Bundle - Fatal编程技术网

Android 找不到方法包()

Android 找不到方法包(),android,gradle,android-app-bundle,Android,Gradle,Android App Bundle,我正在尝试在我的项目中构建appbundle。我遵循官方指南中的步骤,但在gradle sync上出现以下错误。有什么不对劲 * What went wrong: A problem occurred evaluating project ':MyProject'. > Could not find method bundle() for arguments [build_4ng76ykxfhsfa1nuepa3fikmu$_run_closure5$_closure

我正在尝试在我的项目中构建appbundle。我遵循官方指南中的步骤,但在gradle sync上出现以下错误。有什么不对劲

   * What went wrong:
    A problem occurred evaluating project ':MyProject'.
    > Could not find method bundle() for arguments [build_4ng76ykxfhsfa1nuepa3fikmu$_run_closure5$_closure28@6448fs70] on object of type com.android.build.gradle.AppExtension.

我在gradle.properties文件中添加了
android.enableApt2=true
,然后运行。/gradlew--stop

我相信你要找的任务是
bundleRelease
或者
bundleDebug
如果有人面临同样的跟踪,我错过了插件版本。 请检查插件版本

将Android gradle插件版本更新至
3.2.0
或更高版本

classpath "com.android.tools.build:gradle:3.2.0"
你可能丢失了signingConfigs{},这是花括号,我加上这个,然后一切都好了


你可以试试

我想我找到问题了。这是gradle插件版本。请检查一下,gradle插件版本。我认为与插件相关的问题将会出现。@YogeshRathi谢谢,完全忘记了gradle PlugingGood luck,happy Codeing:)
signingConfigs {
    debug {
        keyAlias 'xxxxxx'
        keyPassword 'xxxxx'
        storeFile file('xxxxx')
        storePassword 'xxxxx'
    }
    releaseConfig {}
}