问题描述
为什么在我执行项目时仍然出现此错误?一旦我将image_picker放入我的pubspec中,就会发生这种情况.
Why is this error keep coming when i'm executing my project? It occur once i put the image_picker in my pubspec.
/Users/s/.gradle/caches/transforms-1/files-1.1/design-27.1.1.aar/fa938137e4d19d1dd06a6895b6e14886/res/values/values.xml:96:5-202:AAPT:错误:资源找不到android:attr/ttcIndex. 错误:链接引用失败. 命令:/Users/s/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/6d65e55edb223325e7c5119d99552582/aapt2-3.2.1-4818971-osx/aapt2链接-I \ /Users/s/Library/Android/sdk/platforms/android-27/android.jar \ - 显现\ /Users/s/Desktop/Flutter/a/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml \ -o \ /Users/s/Desktop/Flutter/a/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_ \ -R \ @/Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt \ --auto-add-overlay \ --java \ /Users/s/Desktop/Flutter/a/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r \ --custom-package \ com.example.a \ -0 \ apk \ --output-text-symbols \ /Users/s/Desktop/Flutter/a/build/app/intermediates/symbols/debug/R.txt \ --no-version-vectors 守护程序:AAPT2 aapt2-3.2.1-4818971-osx守护程序#0
/Users/s/.gradle/caches/transforms-1/files-1.1/design-27.1.1.aar/fa938137e4d19d1dd06a6895b6e14886/res/values/values.xml:96:5-202: AAPT: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: /Users/s/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/6d65e55edb223325e7c5119d99552582/aapt2-3.2.1-4818971-osx/aapt2 link -I\ /Users/s/Library/Android/sdk/platforms/android-27/android.jar\ --manifest\ /Users/s/Desktop/Flutter/a/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /Users/s/Desktop/Flutter/a/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /Users/s/Desktop/Flutter/a/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ com.example.a\ -0\ apk\ --output-text-symbols\ /Users/s/Desktop/Flutter/a/build/app/intermediates/symbols/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
推荐答案
将您的compileSdkVersion更改为28(在android/app/build.gradle下)
Change your compileSdkVersion to 28 (under android/app/build.gradle)
然后运行命令
然后再次运行项目.
这篇关于在项目中包含image_picker时出错(Flutter)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!