Reputation: 57
After adding file_picker: ^1.13.3 to my dependencies the project can't build with this error
FAILURE: Build failed with an exception.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade File 'com.android.builder.files.ZipCentralDirectory@7dfb72cd' was deleted, but previous version not found in cache
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 1m 8s Exception: Gradle task assembleDebug failed with exit code 1
but each time i remove it the project builds successfully, please help out i have tried various versions suggested but all to no avail
Here is the android manifest as requested
<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>
Upvotes: 4
Views: 3210
Reputation: 61
Add this one to your Android Manifest file
android:requestLegacyExternalStorage="true"
And Change app compileSdkVersion
to 28 in filepicker build.gradle
file. To get this file you requested to open MainActivity.class
file in andriod folder at right corner Open for Editing android studio click on that it open as new android project. then select file filepicker build.gradle
file.
Hope this will help to you.
I struggle with this issue past 5days, now only I fixed.
Upvotes: 1
Reputation: 1
ADD: android:requestLegacyExternalStorage="true" in your AndroidManifest.xml
ADD: classpath 'com.android.tools.build:gradle:3.6.3' in your android -> build.gradle
ebuildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
}
}
ADD:
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
in your gradle-wrapper.properties
Create a file 'proguard-rules.pro' and write:
-keep class androidx.lifecycle.** { *; }
In your android -> app -> build.gradle add:
android{
buildTypes {
release{
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
``
Upvotes: 0
Reputation: 1808
Because file_picker currently doesn't support scoped storage, you'll need to set android:requestLegacyExternalStorage="true"
on your AndroidManifest.xml file, under :
<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:requestLegacyExternalStorage="true"
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>
Upvotes: 4