Running Gradle task 'assembleDebug'. (This is taking an unexpectedly long time.) - android

when I created a very basic flutter app and ran it for the first time, it works perfectly, and when I try to add some dependencies in my pubspec.yaml file I get no errors in my project but when I run the app by 'flutter run' I get stuck in
Running Gradle task 'assembleDebug'...
(This is taking an unexpectedly long time.)
and the app has never worked
this is my pubspec.yaml file
name: myPDFApp
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
syncfusion_flutter_pdfviewer: ^18.4.35-beta // this is the dep that I want to add
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true

Add an earlier version of the dependencies, and run pub get. This could solve the issue

Related

Can't run the flutter app after added firebase-core and auth to the project

Here's the error in console, plus flutter doctor didn't showed any error. I've tried upgraded the android sdk to 28, check build.gradle. It still don't work and I have no clue.
Error
Pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
google_fonts: ^1.1.1
path_provider: ^1.6.24
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
1- Move them to dependencies
2- Leave a space at the beggining of the dependencie name like so:
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.1
firebase_auth: ^0.18.2
google_fonts: ^1.1.0
provider: ^4.3.2+2
If you realize, it's like if flutter and the rest of your dependencies were at the same level
Its AAPT issue;
Open this open C:\Users\user\Desktop\Projects\Flutter\eLesson\android\app\src\main\AndroidManifest.xml and remove style/Theme.AppCompat.Light.NoActionBar
and
your App or some of you plugin is not compatible to AndroidX. Open android folder of your project in separate Android Studio. Right click on Project->Refactor->Migrate to AndroidX.
Repeat this process for each of your plugin folder.
Clean and Rebuild.
Enjoy.

Project with path 'sdk' could not be found in project 'projectName'

I wrote a Tappay plugin, but I failed to use it.
Please help me, thanks a lot!!
https://pub.dev/packages/tappayflutter
Here's my android error message
Here's my xcode error message
Here's my pubspec.yaml
description: A Flutter framework builded by Tung.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+4
share: ^0.6.3+6
tappayflutter: ^0.0.7
flutter_tappay: ^0.3.0+2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
inside you root dir of project create local.properties file inside it put your sdk path like this :
sdk.dir=/Users/tusharpandey/Library/Android/sdk

Flutter "packages get" failes with error "Couldn't read file LocalFile..."

I have a Flutter project and from one day to another I could not run packages get anymore. It failes with:
Couldn't read file LocalFile:
'LOCAL_FLUTTER_SDK_PATH\flutter.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.6\android\src\main\kotlin\io\flutter\plugins\flutter_plugin_android_lifecycle\FlutterAndroidLifecyclePlugin.kt'
even though it exists. Please verify that this file has read
permission and try again.
Also building the app is since that moment not possible anymore, it failes with the same error.
My pubspec.yaml:
name: my_app
description: My fancy cross plattform app
version: 1.0.0+2
environment:
sdk: ">=2.3.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_cupertino_localizations: ^1.0.1
http: ^0.12.0+2
sqflite:
path:
crypto: ^2.1.3
flutter_typeahead: ^1.7.0
image_picker: 0.3.0
google_maps_flutter: any
http_parser: ^3.1.3
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
intl_translation: ^0.17.7
flutter:
assets:
- assets/
- assets/img/
uses-material-design: true
Note that I created a new project just with the same pubspec.yaml file and there everything works fine. If you have any idea which in my project could cause this error, please tell me I will add that source code then, because the pubspec.yaml seems not to be the reason or at least not the only one.
I have the newest Flutter version (v1.12.13+hotfix.8)
I faced a similar issue. Whenever I run, flutter pub get, I got the following error
flutter Couldn't read file LocalFile: .... flutter_plugin_android_lifecycle\FlutterAndroidLifecyclePlugin.kt' even though it exists. Please verify that this file has read permission and try again.
So, I run these two commands:
flutter clean
flutter pub cache repair
While running the second command, I noticed this new issue:
Failed to repair flutter_plugin_android_lifecycle 1.0.7. Error:
FileSystemException: Deletion failed, path = ...\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.7' (OS Error: The system cannot find the path specified.
Then, following this Packages GET failes with The plugin flutter_plugin_android_lifecycle, I removed the .pub-cache folder in my flutter directory
After that, I run
flutter pub get
Finally, everything starts to work again.

application crash on startup when I add more than 3 other plugins in flutter

I am beginner in flutter, when I add more than 3 other plugins in dependencies of pubspec.yaml my application crash after run it, but if I comment one of the plugins application work very well, please help 😩
this is my code
dependencies:
firebase_auth: ^0.11.1+7
firebase_database: ^3.0.3
shared_preferences: ^0.5.3+1
flutter:
sdk: flutter

rxdart usage in Flutter not being recognized

I am trying to use rxdart package for the first time in my Flutter app and I have added the package in yaml file, then I saved it and vscode automatically ran flutter packages get on project after that complete I tried to import the package with following line
import 'package:rxdart/rxdart.dart';
but the compiler doesn't recognize rxdart within the packages. which is causing the error in the app.
The following are my dependencies of pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
rxdart: ^0.18.0
dev_dependencies:
flutter_test:
sdk: flutter
Update
Here is the repo for the project I am working on: https://www.github.com/touseefbsb/LoginStateful
You have to open the folder login_stateful_bloc and the error is in bloc.dart file where I am trying to import it.
You have to keep the indents :
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
rxdart: ^0.18.0
I was having the same issue. Even after pub get, it didn't work. Then I simply restarted my IDE(Android Studio) and now it works.
this worked for me, make sure you putted the dependencies on
dependencies:
flutter:
not
dev_dependencies:
flutter_test:
if that make sense :/

Categories

Resources