生成.apk文件时配置根项目'screen_state'时发生问题

时间:2020-05-14 09:14:56

标签: flutter dart

当我通过USB调试模式将应用程序上载到设备时,我没有任何问题,该应用程序可以编译。另一方面,当我尝试生成.apk文件时,出现以下错误(见下文)。

错误的主要部分是在构建“√生成build \ app \ outputs \ repo”的“ Building plugin screen_state ...”时。东西

C:\flutter\flutter\flutter\bin\flutter.bat --no-color build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Calling mockable JAR artifact transform to create file: C:\Users\w8.gradle\caches\transforms-2\files-2.1\24dacf9a7334c5e176d55a91fc8a695c\android.jar with input C:\Users\w8\AppData\Local\Android\Sdk\platforms\android-28\android.jar

Calling mockable JAR artifact transform to create file: C:\Users\w8.gradle\caches\transforms-2\files-2.1\ae1fb6be36b667c02cfdb6d84de75e5b\android.jar with input C:\Users\w8\AppData\Local\Android\Sdk\platforms\android-27\android.jar

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

What went wrong:
Execution failed for task ':launch_review:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

Android resource linking failed

 C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.



 C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
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.
2: Task failed with an exception.
What went wrong:
Execution failed for task ':screen_state:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

Android resource linking failed

 C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
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 6m 19s

Running Gradle task 'assembleRelease'... 383.2s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin android_alarm_manager...
Running Gradle task 'assembleAarRelease'... 167.2s (!)
√ Built build\app\outputs\repo.
Building plugin android_intent...
Running Gradle task 'assembleAarRelease'... 590.6s (!)
√ Built build\app\outputs\repo.
Building plugin flutter_upi...
Running Gradle task 'assembleAarRelease'... 205.9s (!)
√ Built build\app\outputs\repo.
Building plugin fluttertoast...
Running Gradle task 'assembleAarRelease'... 509.4s (!)
√ Built build\app\outputs\repo.
Building plugin launch_review...
Running Gradle task 'assembleAarRelease'... 310.0s (!)
√ Built build\app\outputs\repo.
Building plugin open_appstore...
Running Gradle task 'assembleAarRelease'... 147.8s (!)
√ Built build\app\outputs\repo.
Building plugin path_provider...
Running Gradle task 'assembleAarRelease'... 96.9s
√ Built build\app\outputs\repo.
Building plugin path_provider_macos...
Running Gradle task 'assembleAarRelease'... 6.8s
√ Built build\app\outputs\repo.
Building plugin screen_state...
Running Gradle task 'assembleAarRelease'... 161.1s (!)
Downloading https://services.gradle.org/distributions/gradle-4.4-all.zip
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping C:\Users\w8.gradle\wrapper\dists\gradle-4.4-all\9br9xq1tocpiv8o6njlyu5op1\gradle-4.4-all.zip to C:\Users\w8.gradle\wrapper\dists\gradle-4.4-all\9br9xq1tocpiv8o6njlyu5op1
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring root project 'screen_state'.
Could not resolve all files for configuration ':classpath'.
Could not resolve com.google.code.findbugs:jsr305:1.3.9.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01 > com.google.guava:guava:22.0
> Could not resolve com.google.code.findbugs:jsr305:1.3.9.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom'. Received status code 504 from server: Gateway Time-out
Could not resolve org.apache.commons:commons-compress:1.12.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve org.apache.httpcomponents:httpclient:4.2.6.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
> Skipped due to earlier error
Could not resolve org.apache.httpcomponents:httpmime:4.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
> Skipped due to earlier error
Could not resolve net.sf.kxml:kxml2:2.3.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.build:manifest-merger:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.ddms:ddmlib:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools.layoutlib:layoutlib-api:26.1.2
> Skipped due to earlier error
Could not resolve org.jetbrains:annotations:13.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0 > org.jetbrains.kotlin:kotlin-stdlib:1.2.0
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools.layoutlib:layoutlib-api:26.1.2
> Skipped due to earlier error
Could not resolve com.sun.activation:javax.activation:1.2.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve com.google.jimfs:jimfs:1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error

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 2m 40s

The plugin screen_state could not be built due to the issue above.
Process finished with exit code 1

0 个答案:

没有答案