VenusCao/x5_webview_flutter

gradle编译错误

Closed this issue · 10 comments

e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (35, 46): Unresolved reference: MenuItem
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (38, 17): Unresolved reference: finish
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (42, 22): Unresolved reference: onOptionsItemSelected
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (46, 5): 'onDestroy' overrides nothing
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (47, 15): Unresolved reference: onDestroy
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (51, 5): 'onPause' overrides nothing
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (52, 15): Unresolved reference: onPause
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (56, 5): 'onResume' overrides nothing
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewActivity.kt: (57, 15): Unresolved reference: onResume
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (9, 36): Unresolved reference: Context
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (9, 57): Unresolved reference: Activity
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (24, 9): Unresolved reference: QbSdk
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (24, 70): Unresolved reference: QbSdk
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (25, 11): 'onCoreInitFinished' overrides nothing
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (29, 11): 'onViewInitFinished' overrides nothing
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (38, 23): Unresolved reference: TbsVideo
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (43, 20): Unresolved reference: Bundle
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (45, 9): Unresolved reference: TbsVideo
e: /Users/xhli/.pub-cache/hosted/pub.flutter-io.cn/x5_webview-0.1.1/android/src/main/kotlin/com/cjx/x5_webview/X5WebViewPlugin.kt: (50, 20): Unresolved reference: Intent

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':x5_webview:compileDebugKotlin'.

Compilation error. See log for more 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 8s
Finished with error: Gradle task assembleDebug failed with exit code 1

麻烦看一下这个issue,多谢🙏

没有引入kotlin吧

引入了,是因为kotlin版本问题,和我的idea kotlin插件版本不一致。

那你是已经解决了吧

emmm,没有解决,因为改起来好麻烦,我用其他方案了。

版本问题的话修改的话也简单啊
修改你项目的android-->build.gradle-->ext.kotlin_version=‘1.2.71’
或者依赖以后在external lib-->flutter plugins-->x5_webview-->android-->bulid.gradle-->ext.kotlin_version=你使用的版本

是的,然后idea的kotlin plugin版本也要改成一致
image
只是后来发现用其他方案也能解决我的需求。还是多谢你啦🙏

今天发现我是在0.1.1版本push的时候点了导入优化,导入的包全部删除造成的这个原因,请先使用0.1.0版本,稍后会重新上传新版本,抱歉了!!!

0.1.2版本已上传,请使用新版本再试试

ios选手表示不会使用