記錄些自己開發(fā)中碰到的問題,方便自己方便他人祷安。
下面是日志輸出:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared_preferences:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/Users/frc/.gradle/caches/transforms-2/files-2.1/57be7675b54dfb29ebcc82c3cf8bfd14/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/frc/.gradle/caches/transforms-2/files-2.1/57be7675b54dfb29ebcc82c3cf8bfd14/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 32s
Execution failed for task ':xxx(三方庫名):verifyReleaseResources.其實是個挺常見的問題,可能是flutter目前開發(fā)者有限轴合,所以在flutter上不多晓殊。網(wǎng)上一搜都是rect-navtive的。其實主要是版本內部東西于當前版本不兼容魁衙,或者說你當前依賴的三方庫肯能有東西已經(jīng)過期了报腔。
看了下當前的shared_preferences是0.4.2,再到庫下載地址去查下最新的剖淀。
看到我這個庫有點太久了??榄笙,更新下試試。
看到編譯成功了祷蝌。體積比之前還小了好多。
其實我們可以看下他到底有哪些改動
因為之前看到過下面的日志:
* What went wrong:
A problem occurred configuring root project 'flutter_plugin_android_lifecycle'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.5.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.5.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused (Connection refused)
> Could not resolve com.android.tools.build:gradle:3.5.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused (Connection refused)
所以我猜測可能跟下面的升級有關: