我正在尝试运行flutter build apk,但始终收到以下错误。 iOS运行正常。我不确定这里会发生什么。任何帮助将不胜感激。
这是我的pubspec.yaml
intl: ^0.15.6
cupertino_icons: ^0.1.2
firebase_auth: 0.8.1+4
google_sign_in:
cloud_firestore: 0.9.0+1
shared_preferences: ^0.4.3
firebase_messaging: 3.0.1
image_picker:
firebase_storage:
cached_network_image:
firebase_core:
image:
photo_view:
flutter_auth_buttons:
splashscreen:
geolocator: 3.0.0
color: any
folding_cell: "^0.1.0"
google_maps_flutter: 0.3.0
stream_transform: ^0.0.14+1
chewie:
rxdart:
flutter_sms:
flutter_html: ^0.9.4
这是终端中的一些错误。还有更多,但我认为这很关键。
Initializing gradle... 3.1s
Resolving dependencies... 6.8s
Gradle task 'assembleRelease'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
*********************************************************
WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX.
See "link" for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':google_api_availability:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: /Users/remobajwa/Desktop/tu_chat/build/google_api_availability/intermediates/res/merged/release/values/values.xml:197: error: resource android:attr/fontVariationSettings not found.
答案 0 :(得分:1)
如果您想了解有关 AndroidX警告的更多信息, Flutter团队已发布了有关 AndroidX兼容性的完整文章。您可以follow it here。
实际的错误信息如下:
错误:找不到资源android:attr / fontVariationSettings。
有许多资源概述了此问题。我建议您start here。但是,它可能已连接到AndroidX,因此,如果您尚未按照迁移指南进行操作,则可能需要这样做。