I'm trying to run a Flutter app on my phone using VSC.
The app is a clone of this repository:
https://github.com/londonappbrewery/dicee-flutter
This is the error message I'm getting:
https://pastebin.com/MtGCSC98
(I tried to post the code on the post, but SO doesn't allow it since it's "too much code", then I posted only the link to pastebin and it said "too little code" smh. So, here are the first 4 rows...)
c:\Users\mudcip\Desktop\programming\flutter\dicee-flutter\lib>flutter run -v
[ +440 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +223 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +11 ms] 9b2d32b605630f28625709ebd9d78ab3016b2bf6
I tried to search other similar questions but found no solution.
This error occurs because you are running program from lib folder insted running from main project
Related
I use flutter on window 10, when i run flutter on console and perform flutter run -d chrome, the error is waiting for connection from debug service on chrome. The error from chrome page show "The connection cant be reach".
My flutter doctor show i didnt install Visual Studio, but i already used to the Visual Studio Code. Is it a must to install Visual Studio ? Other than that, everything is passed.
I try to run the app on Visual Studio Code, the error is the same. Even on edge, on web-server. The error is the same.
I try to add Dart Debug Extension on Chrome but cannot be enable. Can some help ?
My flutter run -d chrome --verbose show below :
[tag:C:\Users\Administrator\myflutter_app>flutter run -d chrome --verbose
[ +10 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+19685 ms] Waiting for connection from debug service on Chrome... (completed in 20.0s)
[ +2 ms] Synced 30.6MB.
[ +1 ms] <- accept
[ ] Caching compiled dill
[+2477 ms] [CHROME]:
[ +18 ms] [CHROME]: DevTools listening on ws://127.0.0.1:57469/devtools/browser/51db6ac9-54b7-4fb7-bdb4- 25fb1707d9d6]
The problem can be solved by performing the following actions
Upgraded flutter to latest version
Reinstall android studio
run flutter pub upgrade --major-versions
upgrade your chrome to latest
if you are using any extension in VS code to run flutter then there is also a possibility that the extension is not working properly try to change the version.
If it works give me a upvote,I'm new here.
Gradle always get stucked for more than 10 minutes when I build
Here are the logs
+2671 ms] FAILURE: Build failed with an exception.
[ +98 ms] * What went wrong:
[ +1 ms] Gradle could not start your build.
[ +3 ms] > Could not create service of type ChecksumService using
BuildSessionScopeServices.createChecksumService().
[ +7 ms] > Cannot lock checksums cache (/home/pavan/new_project/android/.gradle/checksums) as
it has already been locked by this process.
It's probably related to your cache.
If you're using a Windows OS, clear your .lock cache in this directory (search .lock in the directory itself and remove everything with a .lock extension deleted):
C:\Users<your username>.gradle\caches
If you got a Linux:
/home/ your username /.gradle/caches
If you've got a Mac:
/Users/ your username /.gradle/caches
On Windows 10, I deleted all .lock files located in .gradle directory AFTER having restarted my pc !
Not sure what is going on, but when I hot restart my flutter app crashes using iOS simulator. Hot restart works fine on an Android simulator. I even tried to uninstall and install XCode again.
Here is what gets printed on the terminal
[ +459 ms] Hot restart performed in 924ms.
[ +3 ms] Restarted application in 936ms.
[ +900 ms] Service protocol connection closed.
[ ] Lost connection to device.
[ +3 ms] DevFS: Deleting filesystem on the device (file:///Users/frederickmfinanga/Library/Developer/CoreSimulator/Devices/775342AF-E52F-46EB-9CDB-9C29720FC357/data/Containers/Data/Application/D093EF45-D895-481C-B965-CA56F7881A5C/tmp/the_hair_routinenSBAWo/the_hair_routine/)
Failed to send request: {"jsonrpc":"2.0","id":"46","method":"getMemoryUsage","params":{"isolateId":"isolates/4165970133496907"}}
[ +257 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[ +1 ms] "flutter run" took 646,839ms.
[ +259 ms] ensureAnalyticsSent: 242ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ ] Shutdown hooks complete
[ ] exiting with code 0
I had the same issue. After two days of debugging I have just found out it was caused by one of my dependencies. It is firebase_auth package version 1.1.3.
As I can see the issue is resolved in firebase_auth 1.1.4 released on 10th of May 2021.
So just update to firebase_auth 1.1.4 if you use this package
I faced something similar a few days back.
There can be two possibilities why it is happening :
You have not granted permission for something you are trying to access (like getting the location/camera ). If this is the case then read the docs of the package you might be using and add the permissions programatically.
Sometimes our podfile reference gets corrupted. (This is what happened in my case). For this delete your podfile.lock file (ios/podfile.lock). For a fresh start you can also delete your pubspec.lock as well. And then do a flutter pub get or simply run your app.
I am trying to host all the packages my flutter application depends in svn repo and use it in a system without internet connection(unfortunately git is not possible yet) but has access to this svn repo.
What I did so far:
I do know I can use a path based dependency in my pubspec.yaml by using the path attribute. For e.g.
I can depend on a specific package named xyz by keeping it along with its dependecies in a folder say packages alongside the lib folder as shown below.
project
|_ lib
|_ packages
|_ xyz
|_ dep1_for_xyz
|_ dep2_for_xyz
Then referring to it in pubspec.yaml as shown below and this works.
dependencies:
flutter:
sdk: flutter
xyz:
path: packages/xyz
Problems & question:
I came across this environment variable pub_hosted_url in the following pages: ref1 and ref2.
I tried to use it as follows.
Create an environment variable pub_hosted_url and point it to a directory in the remote svn repo.
for e.g., https://username:password#repository_url/dart_packages.
Then add & commit a package inside this dart_packages folder.
for e.g. built_value_generator-6.8.2 and all its relevant dependencies in a similar fashion.
Then add the dependencies in the pubspec.yaml as usual.
for e.g built_value_generator: ^6.7.1
Then run the flutter pub get -v.
Problem1:
I am currently facing an Handshake error on client side. I understand this because of the certificate that svn server uses. Since its a self signed certificate, flutter/pub/dart is unable to verify the validity of this certificate.
following is the error I see.
[ +528 ms] IO : Retry #1 for GET https://pub_hosted_url/api/packages/built_value_generator...
[ +3 ms] IO : HTTP GET https://pub_hosted_url/api/packages/built_value_generator
[ +2 ms] | Accept: application/vnd.pub.v2+json
[ +2 ms] | user-agent: Dart pub 2.7.0
[ +24 ms] IO : HTTP error:
[ +2 ms] | HandshakeException: Handshake error in client (OS Error:
[ +2 ms] | CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(handshake.cc:354))
[ +1 ms] |
[ +1 ms] | dart:_http _HttpClient.openUrl
[ +2 ms] | package:http/src/io_client.dart 33:36 IOClient.send
[ ] | package:pub/src/http.dart 68:39 _PubHttpClient.send
[ ] | package:http_retry/http_retry.dart 97:33 RetryClient.send
Question1
How do I let flutter pub get know that this is a trusted host or even add this certificate into its trusted list.
Problem 2:
This problem I see is from the above error message, where the packages are looked with the following url format https://pub_hosted_url/api/packages/my_dependency. This means the flutter pub get expects packages to be placed in a very specific format or specific location. I couldn't find any relevant documentation for this apart from this alpha level pub_server package here.
Question 2
So question is What is the correct format of hosting our packages internally in an svn repo, if at all if its possible.
I am getting an error when i try to build my game for android. The error is :
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\halil.cosgun\Desktop\ADTBundle\adt_bundle\sdk\build-tools\21.1.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/halil.cosgun/Desktop/ADTBundle/adt_bundle/sdk\platforms\android-21\android.jar" -F bin/resources.ap_ --extra-packages com.fusepowered.unitytest:com.google.android.gms:com.unity3d.player:com.google.android.gms -S "C:\Users\halil.cosgun\Desktop\Projects\AmbulanceFirstDeneme\Temp\StagingArea\android-libraries\FuseSDK\res" -S "C:\Users\halil.cosgun\Desktop\Projects\AmbulanceFirstDeneme\Temp\StagingArea\android-libraries\google-play-services_lib\res" -S "C:\Users\halil.cosgun\Desktop\Projects\AmbulanceFirstDeneme\Temp\StagingArea\android-libraries\play-services-base-6.5.87\res"
If I delete the play_game_services_libs folder (play_game_services.jar is in there), the build is successful. But, PlayGamesPlatform.Activate() code is not work. If I delete the FuseSDK, the build is successful. I know there is a conflict between this two plugins, but I didn't figure it out how I fix this problem.
Please help me.
Sincerely.
These are the screenshots my project folder :
Actually I didn't know how I can solve this problem at first. I tried so many ways to solve this error. First of all, I updated my JDK to latest version.(jdk1.8.0.65 - 64bit) - Then I deleted play_game_services_6.5.8.7 and AndroidSupportV4 which is in Plugins/Android/ folder. After that I added FuseSDK prefab to main scene of my project. Finally I hit Build and Run.
Before:
After:
Have a nice day! :)