Error when building release apk
ritam749 opened this issue · 1 comments
Sorry for again troubling you, see when i run command:
flutter build apk --release --flavor production --target lib/main.dart --dart-define=SUPABASE_URL=https://hiafvrhvwgytmljrbjwx.supabase.co --dart-define=SUPABASE_ANNON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyMzUwNTMxNSwiZXhwIjoxOTM5MDgxMzE1fQ.Oi1d6ygWatzXNlTbSzMGM34MQZESIwNdRfTgN2TsMvU
It shows error:
`FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:lintVitalProductionRelease'.
Could not resolve all artifacts for configuration ':app:stagingReleaseRuntimeClasspath'.
Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\spot\build\app\intermediates\flutter\stagingRelease\libs.jar.
> Transform's input file does not exist: C:\spot\build\app\intermediates\flutter\stagingRelease\libs.jar. (See https://issuetracker.google.com/issues/158753935)
-
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 11s
Running Gradle task 'assembleProductionRelease'...
Running Gradle task 'assembleProductionRelease'... Done 12.4s
Gradle task assembleProductionRelease failed with exit code 1
I tried searching on google and tried all the answers on stack overflow but none worked .Could please help me, I would be obliged.
Thank you in advance
Hey @ritam749 !
No worries at all! Thanks for being so polite!
First, is this just to run your app locally? If so, I would try doing flutter run flutter run --profile
instead of flutter build apk
, because it would spin up a release version of the app on your device right away!
If this is to distribute the app to someone, then you have to make few more changes to the code. Essentially, you would need to do what is described here . Also, it might make sense to change the bundle id of the production app to something different. You can do that here. When you change the bundle ID, you would have to create a whole new firebase config file and upload it here!