netease-im / NIM_ReactNative_Demo

109 stars 37 forks source link

安卓端同步报错Could not find method register() #36

Closed SpectreAlan closed 4 years ago

SpectreAlan commented 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.

SpectreAlan commented 4 years ago

问题已解决,把 tasks.register('forwardDebugPort', Exec) { 改成 task forwardDebugPort(type: Exec) {