lcfarm_flutter_umeng icon indicating copy to clipboard operation
lcfarm_flutter_umeng copied to clipboard

Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

Open iyuhang opened this issue 4 years ago • 2 comments

已添加 dependencies { api 'com.umeng.sdk:common:latest.integration' api 'com.umeng.sdk:analytics:latest.integration' }

flutter 1.12.13

错误日志

/Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:16: error: class, interface, or enum expected public void onResume() { ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:18: error: class, interface, or enum expected MobclickAgent.onResume(this); ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:20: error: class, interface, or enum expected } ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:22: error: class, interface, or enum expected public void onPause() { ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:24: error: class, interface, or enum expected MobclickAgent.onPause(this); ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:25: error: class, interface, or enum expected } ^ 6 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s Gradle task assembleDebug failed with exit code 1

iyuhang avatar Mar 12 '20 04:03 iyuhang

我也遇到了这个问题 楼主有没有解决啊

0-php avatar Jul 28 '20 12:07 0-php

已添加 dependencies { api 'com.umeng.sdk:common:latest.integration' api 'com.umeng.sdk:analytics:latest.integration' }

flutter 1.12.13

错误日志

/Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:16: error: class, interface, or enum expected public void onResume() { ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:18: error: class, interface, or enum expected MobclickAgent.onResume(this); ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:20: error: class, interface, or enum expected } ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:22: error: class, interface, or enum expected public void onPause() { ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:24: error: class, interface, or enum expected MobclickAgent.onPause(this); ^ /Users/apple/Flutter/projects/fixtime/android/app/src/main/java/com/example/fixtime/MainActivity.java:25: error: class, interface, or enum expected } ^ 6 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  • Get more help at https://help.gradle.org

BUILD FAILED in 3s Gradle task assembleDebug failed with exit code 1

这个是因为插件的pubspec.yaml文件中少了东西

plugin: androidPackage: com.nongfadai.lcfarm_flutter_umeng pluginClass: LcfarmFlutterUmengPlugin

导致插件里面的类没被编译到工程中去才报错的

如果你不想改你插件下的代码,你可以改下你工程下的pubspec.yaml文件

lcfarm_flutter_umeng: git: url: https://github.com/MrLiuYS/lcfarm_flutter_umeng.git

把旧的lcfarm_flutter_umeng删掉后点下pub get

coku00 avatar Jul 29 '20 06:07 coku00