I am trying to create a new application with flutter, and i want to use package cached network image, but the package don't want to install in my pubspec.yaml
I tried flutter upgrade, and flutter doctor show no error
dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.14.0+2
firebase_core: ^0.4.0+8
cloud_firestore: ^0.12.9
firebase_storage: ^3.0.5
font_awesome_flutter: ^8.5.0
fluttertoast: ^3.1.0
image_picker: ^0.6.1+3
cached_network_image: ^1.1.1
C:\fltr\flutter\bin\flutter.bat --no-color packages get
Running "flutter pub get" in socialflutter_app...
Error on line 1, column 1 of ..\..\..\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cached_network_image-1.1.1\pubspec.yaml: Unexpected character.
โท
1 โ
โ ^
โต
pub get failed (65)
Process finished with exit code 65
Try navigating to your Flutter folder, then to pub-cache\hosted\pub.dartlang.org\ and remove all cached_network_image folders.
then run flutter packages get again in your project.
Related
I'm trying to build in production mode my flutter app for web, but I have my "main.dart" file not in the root lib directory, this cause to not be able to build my app for web, I have tried to point the path to where the "main.dart" file is, like:
flutter build web path/to/my/main/file/main.dart --release
But ended out with an error message like:
๐ช Building with sound null safety ๐ช
Compiling lib/main.dart for the Web...
Target dart2js failed: Exception: .dart_tool/flutter_build/72a548668e340c281af31f7867ace19b/main.dart:8:8:
Error: Error when reading 'lib/main.dart': Error reading 'lib/main.dart' (No such file or directory)
import 'package:the_movie_db_app/main.dart' as entrypoint;
^
.dart_tool/flutter_build/72a548668e340c281af31f7867ace19b/main.dart:13:14:
Error: Method not found: 'main'.
entrypoint.main();
^^^^
Error: Compilation failed.
This command works when you try to build an APK, but not to build a flutter web app.
Can somebody please tell me how to solve this?
add -t before your main.dart path.
eg.
flutter build web -t lib/main-dev.dart
I have a react application that was created with create-react-app and is using react-scripts version 3.4.2. The app works great but when I run eslint against it I get many invalid no-unused-vars errors. By invalid I mean that when I go to the file that variable is actually being used.
Based on this answer it seems the issue is related to #typescript-eslint/parser and #typescript-eslint/eslint-plugin. So I went ahead and executed npm list #typescript-eslint/parser #typescript-eslint/eslint-plugin on my app and this is what I get:
myapp#0.1.0 /Users/diego/myapp/client
โโโฌ react-scripts#3.4.2
โโโฌ #typescript-eslint/eslint-plugin#2.34.0
โ โโโ #typescript-eslint/parser#2.34.0 deduped
โโโ #typescript-eslint/parser#2.34.0
โโโฌ eslint-config-react-app#5.2.1
โโโ #typescript-eslint/eslint-plugin#2.34.0 deduped
โโโ #typescript-eslint/parser#2.34.0 deduped
As seen all occurrences of the two potentially conflictive libraries are included by react-scripts app and that is why I am trying to update it.
I tried updating to 4.0.3 and when I do that eslint starts to work fine (those incorrect no-unused-vars are gone) but my app is unresponsive (I click on different buttons and/or links and nothing happen). The only error I see in the console after the update is this one:
Uncaught ReferenceError: process is not defined
at Object.4043 (<anonymous>:2:13168)
at r (<anonymous>:2:306599)
at Object.8048 (<anonymous>:2:9496)
at r (<anonymous>:2:306599)
at Object.8641 (<anonymous>:2:1379)
I was searching this error and I found this question. The error is the same maybe not what the developer describes but reading through the answers I see many of them point to react-scripts as the root cause and that maches my scenario.
I tried some of the solutions in that question, in particular method 1 from this answer (I did not try method 2 because I am not sure if adding craco is what I want) and the solution from this other answer too but they do not work.
I also tried updating to react-scripts version 5 but I get A LOT of errors.
Is someone facing this issue or at least has some clue that could help me?
Thanks in advance.
The error message that you shared seems to be related to a bug with react-error-overlay.
react-scripts 4.0.3. uses react-error-overlay 6.0.9. However, 6.0.10 is marked as a patch, so npm uses 6.0.10 instead of 6.0.9, but 6.0.10 is not compatible with 6.0.9.
On the other hand, react-scripts 5 does not use react-error-overlay, but might be causing breaking changes with your other packages, hence the other errors.
You can find more information about the react-error-overlay bug in these issues on the CRA repository:
Hot Reload Fails, DOM adds an additional iframe containing entire
contents of the html DOM element #11880
Is this the bug of react-error-overlay? #11773
v5 Regression react-error-overlay build - Uncaught ReferenceError:
process is not defined #11771
Here's a possible solution with react-scripts 4.0.3.:
In your project's package.json file:
In dependencies, โset the react-scripts version to 4.0.3.
Under dependencies, in resolutions, add react-error-overlay 6.0.9.
In devDependencies, add react-error-overlay 6.0.9.
"dependencies": {
...
โ "react-scripts": "4.0.3",
...
},
"resolutions": {
โ"react-error-overlay": "6.0.9"
},
...
"devDependencies": {
...
"react-error-overlay": "6.0.9",
...
}
Delete your project's node_modules folder and package-lock.json file.
Run npm install.
Run npm install react-error-overlay#6.0.9.
https://github.com/eee-c/dart-comics
I installed the Dart SDK to run the above web app. The environment is Debian. Then I migrated to the folder /dart-comics-your_first_dart_app and did a "pub install" and got the following output.
pub install
pubspec.yaml has no lower-bound SDK constraint.
You should edit pubspec.yaml to contain an SDK constraint:
environment:
sdk: '>=2.10.0 <3.0.0'
See https://dart.dev/go/sdk-constraint
And after that, I changed the contents of pubspec.yaml as follows, and got the following error. How can I run it?
name: Dart Comics
dependencies:
dirty: any
uuid: any
json: any
environment:
sdk: '>=2.10.0 <3.0.0'
pub install
Error on line 1, column 7 of pubspec.yaml: "name" field must be a valid Dart identifier.
โท
1 โ name: Dart Comics
โ ^^^^^^^^^^^
โต
Use like this :
"name: Dart_Comics"
Just using _ will solve this issue.
I have recently installed Titanium Studio. Upon opening the program i get the error
"An internal error occurred during: "Computing SDK Info...".
java.lang.NullPointerException"
If i attempt to create a new emulator i get the error:
"An internal error occurred during: "Refreshing provisioning information...".
java.lang.NullPointerException"
Ive seen this question a million times but I cant get anything to work. I uninstalled and reinstalled node. I heard Titanium Studio wasnt working with node v12 so i went back to 0.10. I uninstalled and reinstalled java i reinstalled the java sdk i re installed the android sdk, i have attempted to "sudo npm install titanium -g" about 50 times and it always returns
Users/admin/.nvm/v0.10.36/bin/ti -> /Users/admin/.nvm/v0.10.36/lib/node_modules/titanium/bin/titanium
/Users/admin/.nvm/v0.10.36/bin/titanium -> /Users/admin/.nvm/v0.10.36/lib/node_modules/titanium/bin/titanium
titanium#3.4.1 /Users/admin/.nvm/v0.10.36/lib/node_modules/titanium
โโโ sprintf#0.1.5
โโโ colors#0.6.2
โโโ longjohn#0.2.4
โโโ humanize#0.0.9
โโโ async#0.2.10
โโโ wrench#1.5.8
โโโ semver#2.2.1
โโโ fields#0.1.23 (keypress#0.2.1)
โโโ optimist#0.6.1 (wordwrap#0.0.2, minimist#0.0.10)
โโโ temp#0.6.0 (osenv#0.0.3, rimraf#2.1.4)
โโโ winston#0.6.2 (cycle#1.0.3, stack-trace#0.0.9, eyes#0.1.8, pkginfo#0.2.3, async#0.1.22, request#2.9.203)
โโโ request#2.27.0 (json-stringify-safe#5.0.0, aws-sign#0.3.0, forever-agent#0.5.2, qs#0.6.6, tunnel-agent#0.3.0, oauth-sign#0.3.0, cookie-jar#0.3.0, mime#1.2.11, node-uuid#1.4.2, form-data#0.1.4, hawk#1.0.0, http-signature#0.10.1)
โโโ moment#2.4.0
โโโ jade#0.35.0 (character-parser#1.2.0, commander#2.0.0, mkdirp#0.3.5, with#1.1.1, transformers#2.1.0, constantinople#1.0.2, monocle#1.1.50)
โโโ node-appc#0.2.14 (diff#1.0.8, node-uuid#1.4.2, xmldom#0.1.19, semver#2.1.0, adm-zip#0.4.7, dox#0.4.6, uglify-js#2.3.6)
running "ti info" returns
|[ERROR] Failed to run command "info"
/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
logger.log (/usr/local/lib/node_modules/titanium/lib/logger.js:72:21),target. (anonymous function) [as error] (/usr/local/lib/node_modules/titanium/node_modules/winston/lib/winston/common.js:4 5:21),CLI.<anonymous> (/usr/local/lib/node_modules/titanium/lib/cli.js:955:17),/usr/local/lib/node_modul es/titanium/node_modules/async/lib/async.js:119:25,Object.<anonymous> (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:24:16),CLI._ fireHookCallback (/usr/local/lib/node_modules/titanium/lib/hook.js:269:12),/usr/local/lib/node_modu les/titanium/lib/hook.js:248:10,/usr/local/lib/node_modules/titanium/node_modules/ async/lib/async.js:232:13,async.eachSeries (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:130:20)"
and "check" ing titanium in setup gives me this information:
Check Environment
Node.js
โ node up-to-date (v0.12.0)
โ
npm new version v2.6.1 available! (currently v2.5.1)
Titanium CLI
โ cli up-to-date (v3.4.1)
Titanium CLI Dependencies
โ async up-to-date (v0.2.10)
โ colors up-to-date (v0.6.2)
โ fields up-to-date (v0.1.23)
โ humanize up-to-date (v0.0.9)
โ jade up-to-date (v0.35.0)
โ longjohn up-to-date (v0.2.4)
โ moment up-to-date (v2.4.0)
โ node-appc up-to-date (v0.2.14)
โ optimist up-to-date (v0.6.1)
โ request up-to-date (v2.27.0)
โ semver up-to-date (v2.2.1)
โ sprintf up-to-date (v0.1.5)
โ temp up-to-date (v0.6.0)
โ winston up-to-date (v0.6.2)
โ wrench up-to-date (v1.5.8)
Titanium SDK
โ latest sdk installed (v3.5.0.GA)
โ selected sdk selected Titanium SDK "vundefined" is not installed
Mac OS X Environment
โ CLI Tools installed
iOS Environment
โ Xcode installed (6.1.1)
โ iOS SDK installed (8.1)
โ WWDR cert installed
! developer cert not found
! distribution cert not found
! dev provisioning not found
! dist provisioning not found
Android Environment
! sdk Android SDK not found
! targets no targets found
! avds no avds found
โ ndk installed (undefined)
โ ndk-build installed (undefined)
Java Development Kit
โ jdk JDK not found!
Intelยฎ Hardware Accelerated Execution Manager (HAXM)
โ compatible
โ installed
Network
โ online
- no proxy server configured
โ http request test
โ https request test
Directory Permissions
โ home directory
โ titanium config directory
โ titanium sdk install directory
โ temp directory"
I have tried deleting my config.json file and letting Titanium recreate it and setting the properties in the cli but absolutely nothing changes these errors. I am really at my wits end here. I really really need some kind of help so if anybody please knows how to just make Titanium Studio work I would be so grateful, Ive been trying for days...
Did you actually downgrade Node correctly? In your log above I see:
โ node up-to-date (v0.12.0)
(Should be 0.10.35)
Have you tried running titanium sdk select [version] ?
My ISP in India has decieded to block Github for some reason.I have been trying to install Package Control for Sublime Text 3 both manually and use the Sublime Text 3 Console.In both of the cases,one dependency seems to be missing:
Package Control: Installing 1 missing dependencies
Package Control: Attempting to use Urllib downloader due to WinINet error: Error downloading package. Host not found (errno 12007) during HTTP write phase of downloading https://codeload.github.com/codexns/sublime-bz2/zip/1.0.0.
Package Control: Error downloading package. URL error [Errno 11004] getaddrinfo failed downloading https://codeload.github.com/codexns/sublime-bz2/zip/1.0.0.
error: Package Control
Unable to download bz2. Please view the console for more details.
Package Control: Skipping automatic upgrade, last run at 2015-01-03 11:32:25, next run at 2015-01-03 12:32:25 or after
I have downloaded the Sublime bz2 file manually,what should I do now?
EDIT:
Some skimming through stuff tells me that Package Control 3.0 has dependencies:
Once the package is extracted, a custom-generated python file is added to a special package named
0_package_control_loader. For Sublime Text 3, this is a .sublime-package file, whereas for
Sublime Text 2 it is just a folder. The reason for the name (and creating it as a .sublime-
package file in ST3) is to ensure it is the very first non-default package that Sublime Text
loads.
Is there a version of 0_package_control_loader.sublime-package that I can add manually(given that I have already installed Package Control with this dependency missing?
I've met the same problem as you. Below is the way I resolved it.
Try to get the file "sublime-bz2-1.0.0.zip". (It seems you have done it);
unzip it to the dictory "...\Application Data\Sublime Text 3\Packages\" and rename the sub-dictory name to "bz2".
open a new txt file and paste below code to it
{"platforms": ["*"], "url": "https://github.com/codexns/sublime-bz2/issues";, "version": "1.0.0", "description": "Python bz2 module", "sublime_text": "*"}
save the file to /bz2 and rename its file name as "dependency-metadata.json"
After done these, the hierarchy should be like this:
/Package
โโ/bz2
โ โโ/st2_linux_x32
โ โโ/st2_linux_x64
โ โโ/st2_windows_x32
โ โโ/st2_windows_x64
โ โโ/st3_linux_x32
โ โโ/st3_linux_x64
โ โโ/st3_osx_x64
โ โโ/st3_windows_x32
โ โโ/st3_windows_x64
โ โโdependency-metadata.json
โโ/User
โโ/c2u_tmp
โโ/Package Control.cache
restart sublime text3.
Hope it helps!
Regards
This worked for me, see: #godzig's answer, on this related Github issue: issues/989. The gist of it being:
open the 0_package_control_loader.sublime-package archive, in Installed Packages, of your SBT3 folder. Change the filename from 02-bz2.py to 01-bz2.py, and the error is gone; at least in my case anyway.
HTH
I got the same problem and I try and fix it by use manual installation like this:
Manual
If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:
Click the Preferences > Browse Packagesโฆ menu
Browse up a folder and then into the Installed Packages/ folder
Download Package Control.sublime-package and copy it into the Installed Packages/ directory
Restart Sublime Text
Until your ISP unblocks Github (who does that?), you can download 0_package_control_loader.sublime-package here. I don't know if there are differences in the package for different versions of Windows, but this is from ST3 on Win8. Hope it helps!
Machael Lv's answer didn't help for me.
Then i just started sublime text as administrator for one time and problem dissapeared - now i can run sbt as ussual and error message doesn't appear again.
import urllib.request,os,hashlib;
h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1';
pf = 'Package Control.sublime-package';
ipp = sublime.installed_packages_path();
urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) );
by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read();
dh = hashlib.sha256(by).hexdigest();
print('Error validating download (got %s instead of %s), please try manual install' % (dh, h))
if dh != h
else open(os.path.join( ipp, pf), 'wb' ).write(by)