flutter error javax.xml.bind.UnmarshalException - android

when I try to build apk in my flutter project
the terminal show me a lot of lines problems in Gradle I tried to use flutter build apk no sound null safety and also the project is related to firebase
Could not determine the dependencies of task ':app:lintVitalRelease'.
Could not resolve all dependencies for configuration ':app:lintClassPath'.
Could not create task ':app:minifyReleaseWithR8'.
> javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Fin pr�matur�e du fichier.]
my dependencies
version: 1.0.0+1
environment:
sdk: ">=2.16.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
firebase: ^9.0.3
firebase_core: ^1.15.0
firebase_auth: ^3.3.16
cloud_firestore: ^3.1.13
dev_dependencies:
flutter_test:
sdk: flutter

Related

Error while install exists Flutter project

Error while dart run build_runner build
Log: https://pastebin.com/k0gpWuun
Verbose Log: https://pastebin.com/BNgVh6pV
pubspec.yaml:
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
webview_flutter: ^2.0.9
flutter_inappwebview: ^5.3.2
url_launcher: ^6.0.8
flutter_svg: ^0.22.0
uni_links: ^0.5.1
flutter_webview_plugin: ^0.4.0
flutter_share: ^2.0.0
package_info_plus: ^1.0.6
dio: ^4.0.0
sign_in_with_apple: ^3.0.0
google_sign_in: ^5.1.0
json_serializable: ^4.1.4
build: ^2.1.0
get_it: ^7.2.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
flutter clean and other cmd's not working for me
Reinstall Flutter, migrate to Linux (heh), reinstall sdk's
Please update your pubspec.yaml file to
dependencies:
analyzer: ^5.4.0 <- add this
dev_dependencies:
build_runner: ^2.3.3 <- add into dev_dependecies

How to solve the exception "The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher."

I have a flutter mobile application. When I do flutter run, I get the following error. I am not so familiar with Android. I know that I am not using "sign_in_with_apple" my self.
Things that I tried but did not help:
flutter clean
rm pubspec.lock
flutter pub upgrade
flutter pub upgrade --major-versions
Could someone help.
Thanks
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':sign_in_with_apple' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
Here is how the android/build.gradle looks like:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.14'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is how my pubspec.yaml file looks like:
name: ###
description: ###
version: 1.1.1+18
publish_to: none
environment:
sdk: '>=2.18.6 <3.0.0'
flutter: 3.3.8
dependencies:
android_id: ^0.1.3+1
badges: ^2.0.3
cached_network_image: ^3.2.3
carousel_slider: ^4.2.0
cloud_firestore: ^4.2.0
cloud_functions: ^4.0.6
connectivity_plus: ^3.0.2
device_info_plus: ^8.0.0
dotted_border: ^2.0.0+3
firebase_app_check: ^0.1.1+6
firebase_auth: ^4.1.5
firebase_core: ^2.3.0
firebase_dynamic_links: ^5.0.8
firebase_messaging: ^14.1.4
firebase_remote_config: ^3.0.7
firebase_storage: ^11.0.7
flash: ^2.0.5
flutter:
sdk: flutter
flutter_dotenv: ^5.0.2
flutter_facebook_auth: ^4.4.1+1
flutter_hooks: ^0.18.5+1
flutter_image_compress: ^1.1.3
flutter_launcher_icons: ^0.11.0
flutter_local_notifications: ^12.0.4
flutter_localizations:
sdk: flutter
flutter_slidable: ^2.0.0
flutter_svg: ^1.1.6
flutterfire_ui: ^0.4.3+20
geocoding: ^2.0.5
geolocator: ^9.0.2
google_fonts: ^3.0.1
google_sign_in: ^5.4.2
hooks_riverpod: ^2.1.1
http: ^0.13.5
image_cropper: ^3.0.1
image_picker: ^0.8.6
intl: ^0.17.0
linkable: ^3.0.1
material_design_icons_flutter: ^6.0.7096
open_mail_app: ^0.4.5
package_info_plus: ^3.0.2
path_provider: ^2.0.11
pattern_formatter: ^2.0.0
permission_handler: ^10.2.0
photo_view: ^0.14.0
purchases_flutter: ^4.5.0
rate_my_app: ^1.1.3
share_plus: ^6.3.0
shared_preferences: ^2.0.15
shimmer: ^2.0.0
store_redirect: ^2.0.1
timeago: ^3.3.0
tuple: ^2.0.1
url_launcher: ^6.1.7
uuid: ^3.0.7
webview_flutter: ^3.0.4
dev_dependencies:
flutter_test:
sdk: flutter
mocktail: ^0.3.0
very_good_analysis: ^3.1.0
flutter:
uses-material-design: true
generate: true
assets:
- assets/env/
- assets/email_icons/
- assets/flags/
- assets/images/
- assets/json/
- assets/social_icons/
UPDATE:
I replace the deprecated flutterfire_ui with firebase_ui_firestore as suggested by #Yashraj. After running "flutter clean" and "flutter run", I am getting the following error:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/aimnblbol/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDevelopmentDebug'.
> Process 'command '/Users/aimnblbol/Developer/flutter/bin/flutter'' finished with non-zero exit value 1
I noticed that the only way I can run successful "flutter run" is if I delete android/app/build but when I try to run the command again for another android device. The build fails.
You got this error because flutterfire_ui: ^0.4.3+20 package is depends on sign_in_with_apple.
flutterfire_ui is deprecated.
You need to follow some steps to configure flutterfire_ui.
Read Readme file : https://pub.dev/packages/flutterfire_ui
Can you try changing the version of Kotlin as shown and try:
dependencies{
classpath "org.jetbrains,kotlin:kotlin-gradle-plugin:1.6.10"
}

flutter AAPT: error: resource android:attr/lStar not found

I'm trying to build the apk of my project but I got:
* What went wrong:
Execution failed for task ':audioplayers:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:C:\Users\pc\.gradle\caches\transforms-3\1c118aff0ddf4faaf93ec03867fed550\transformed\core-1.9.0-rc01\res\values\values.xml:104:5-113:25: AAPT: error: resource android:attr/lStar not found.
I don't know what this means, nor how to solve it, I saw online that I should have this line
implementation "androidx.core:core-ktx:1.6.0"
in mine app/build.grande but I tried and nothing changes.
Plugins I'm currently using:
cupertino_icons: ^1.0.5
path_provider: ^2.0.11
encrypt: ^5.0.1
flutter_speed_dial: ^6.0.0
telephony: ^0.2.0
audioplayers: any
flutter_audio_recorder2: ^0.0.2
flutter_local_notifications: ^9.7.0
flutter_launcher_icons: ^0.9.0
camera: ^0.10.0+1
image_picker: any
imgur: any
permission_handler: ^10.0.0
flutter_sms: ^2.3.3
audio_session: ^0.1.10
flutter_sound: ^9.2.13
flutter_sound_platform_interface: ^9.2.13
lottie: ^1.4.1
file_picker: ^5.0.1
environment: ^0.0.2
argon_buttons_flutter: ^1.1.0
flutter_native_splash: ^2.2.7
background_sms: ^0.0.4
animations: ^2.0.3
Override the http package to the latest one by including dependency_overrides in the pubspec.yaml. It's going to be like the following:
dependency_overrides:
http:
version: ">=0.13.5"
Also, set audioplayers version to ^1.0.1.
dependencies:
audioplayers: ^1.0.1
# ...

Error: Unable to 'pub upgrade' flutter tool

I'm a newbie in flutter, what should I do in this case?
Thank you all.
This is the Error message
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Error on line 14, column 6 of pubspec.yaml: Expected ':'.
dds: 2.0.4
^
and in the line 14, it's a comment out like this
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
I can't figure it out what cause this error
This is my pubspec.yaml file
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_auth: ^3.1.4
cloud_firestore: ^2.5.3
firebase_core: ^1.8.0
firebase_storage: ^10.0.6
provider: ^6.0.1
image_picker: ^0.8.4+3
file_picker: ^4.1.6
transparent_image: ^2.0.0
shared_preferences: ^2.0.8
qr_code_scanner: ^0.5.2
cupertino_listview: ^2.0.0
zefyr: ^0.12.0
cupertino_icons: ^1.0.2
image_picker_for_web: ^2.1.4
firebase_storage_web: ^3.0.4
shared_preferences_web: ^2.0.2
url_launcher_web: ^2.0.4
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
assets:
- assets/images/
When I use flutter command, it always jump out
This is the Error message
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Error on line 14, column 6 of pubspec.yaml: Expected ':'.
dds: 2.0.4
^

Flutter Build Failed because of pubsec dependencies (audioplayer)

I was trying to add audioplayers: ^0.13.2 to the pubsec.yaml file.
At first it was working then after a while when I run the app there's an error in the Build:
Could not determine the dependencies of task ':audioplayers:compileDebugAidl'.
Failed to find target with hash string 'android-28' in: C:\Users\myRepo\AppData\Local\Android\sdk
My pubsec:
flutter:
sdk: flutter
http: ^0.12.2
firebase_database: ^6.0.0
audioplayers: ^0.7.8
firebase_messaging: ^7.0.3

Categories

Resources