简体   繁体   English

安装 wechat_assets_picker 后无法构建 Flutter App (Android)

[英]Cannot build Flutter App (Android) after install wechat_assets_picker

I recently installed wechat_assets_picker , however when trying to build for android I get the following error, nothing in thier docs about it and no issues on thier issue list either.我最近安装了wechat_assets_picker ,但是在尝试为 android 构建时,我收到以下错误,他们的文档中没有关于它的内容,他们的问题列表中也没有任何问题。

e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerDeleteManager.kt: (116, 36): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerDeleteManager.kt: (119, 36): Unresolved reference: createTrashRequest
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerPlugin.kt: (341, 84): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/utils/Android30DbUtils.kt: (34, 34): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/utils/IDBUtils.kt: (27, 67): Unresolved reference: R
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':photo_manager:compileReleaseKotlin'.        
> Compilation error. See log for more details   

The erroring line is @RequiresApi(Build.VERSION_CODES.R) which from what I understand means this function on runs in version R of the android SDK, which is OS11, so should not be affecting the build? The erroring line is @RequiresApi(Build.VERSION_CODES.R) which from what I understand means this function on runs in version R of the android SDK, which is OS11, so should not be affecting the build?

I checked with the example project which is running SDK min 21 and compiled of 29.我检查了运行 SDK min 21 并编译为 29 的示例项目。

Mine is running 19 and 21, however changign to 21 did not get around the build error so there must be more to is than that?我的运行的是 19 和 21,但是更改为 21 并没有解决构建错误,所以必须有更多的东西吗?

TIA TIA

The issue is as a result of the compiledSdkVersion being set to 29, it needs to be set to 30问题是因为已compiledSdkVersion的SdkVersion 设置为 29,它需要设置为 30

Each time you upgrade your pubspecs, or run a pub upgrade, you need to run flutter clean .每次升级 pubspecs 或运行 pub 升级时,都需要运行flutter clean And it should solved.它应该解决。 Specific to the photo_manager.特定于 photo_manager。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM