如何解决Flutter file_picker插件无法构建项目
在将file_picker:^ 1.13.3添加到我的依赖项后,该项目无法生成此错误
失败:构建失败,并出现异常。
- 出了什么问题: 任务':app:mergeDebugJavaResource'的执行失败。
执行com.android.build.gradle.internal.tasks.Workers $ ActionFacade时发生故障 文件'com.android.builder.files.ZipCentralDirectory@7dfb72cd'已删除,但在缓存中找不到以前的版本
-
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。使用--scan运行以获取完整的见解。
- 获得更多帮助
在1m 8s内失败 异常:Gradle任务assembleDebug失败,退出代码为1
但是每次我删除它时,项目都会成功构建,请帮助我尝试了建议的各种版本,但都无济于事
这是要求的android清单
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.www.app">
<application
android:name="io.flutter.app.FlutterApplication"
android:label="finosellapp"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
解决方法
由于file_picker当前不支持作用域存储,因此您需要在AndroidManifest.xml文件的{:1}下设置signinRedirect
。
this.options.acr_values = 'ipd:oktatest';
this.userManager.signinRedirect(this.options);
this.userManager = new UserManager({
authority: environment.stsAuthority,client_id: window.location.hostname,...});
,
添加: 您的AndroidManifest.xml中的android:requestLegacyExternalStorage =“ true”
添加: android中的classpath'com.android.tools.build:gradle:3.6.3'-> build.gradle
{
"deidentifyTemplate": {
"deidentifyConfig": {
"infoTypeTransformations": {
"transformations": [
{
"primitiveTransformation": {
"cryptoHashConfig": {
"cryptoKey": {
"kmsWrapped": {
"cryptoKeyName": "projects/project-test-123/locations/global/keyRings/keyring1/cryptoKeys/key1","wrappedKey": "CiQA4yqJRKIrMRQCdYdsSHIhqGthDuuxnhBOLN512drs6f59tt4SOQAwcYzUXvT1tJQmHHhqycGMj/lB+UPkmIb7j+QcIGxtQuMbuqG2xdRC8WVMQ9MFJ9tuOO6vxJqaVw=="
}
}
}
}
}
]
}
}
},"templateId": "test1"
}
添加:
ebuildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
}
}
在您的gradle-wrapper.properties
创建一个文件'proguard-rules.pro'并输入:
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
在您的android->应用-> build.gradle中添加:
-keep class androidx.lifecycle.** { *; }
``
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。