Closed SpectreAlan closed 4 years ago
build.gradle文件第23行 tasks.register('forwardDebugPort', Exec) { def adb = android.getAdbExe()?.toString() ?: 'false' commandLine adb, 'forward', 'tcp:8083', 'tcp:8083' ignoreExitValue true doLast { if (execResult.getExitValue() != 0) { logger.error( ....... 报错如下: Gradle sync failed: Could not find method register() for arguments [forwardDebugPort, class org.gradle.api.tasks.Exec, build_2torxjpq4wwfxdsd5a8b3z376$_run_closure2@7bb92c3b] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
问题已解决,把 tasks.register('forwardDebugPort', Exec) { 改成 task forwardDebugPort(type: Exec) {
build.gradle文件第23行 tasks.register('forwardDebugPort', Exec) { def adb = android.getAdbExe()?.toString() ?: 'false' commandLine adb, 'forward', 'tcp:8083', 'tcp:8083' ignoreExitValue true doLast { if (execResult.getExitValue() != 0) { logger.error( ....... 报错如下: Gradle sync failed: Could not find method register() for arguments [forwardDebugPort, class org.gradle.api.tasks.Exec, build_2torxjpq4wwfxdsd5a8b3z376$_run_closure2@7bb92c3b] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.