Unable to launch web project through dart editor - dart

Just starting up on Dart and I am unable to launch web project from dart editor, command line projects work fine.
I get this exception while trying to start web project
Running pub get on C:\Users\Admin\dart\DartABWebApp ... ---
Pub get failed, [69] Resolving dependencies...
Got socket error trying to find package browser at https://pub.dartlang.org.
Anyone knows how to resolve this ?

I moved the installation directly under primary drive and that did the trick

Related

Failed to start the Dart CLI isolate. Could not resolve DartDev snapshot or kernel. (null)

I have some error while trying to run dart file, saying
Failed to start the Dart CLI isolate. Could not resolve DartDev snapshot or kernel.
(null).
NOTE: iam not installing flutter
The problem is in my dart SDK, the SDK was corrupt and to solve this issue just delete last installed SDK and install new one.

Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64'

I have created fresh project(Hello World) in KMM followed by their official website. In android it works smooth but when I am trying to run in XCode it's giving errors because of which I am unable to build / run the xcode project. I have attached screenshots and logs for my errors. Somehow xcode scheme is not getting generated in the KMM platform that's what I am guessing.
Can anyone please help me understand what am I missing?
Any help would be appriciated.
Following is my dev env:
Xcode 11.4.1
Android 4.1.2
Kotling Plugin version 1.4.30 (stable)
KMM 0.2.0```
XCode Logs:
> Task :shared:compileKotlinIosX64
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Extracting dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz into /Users/fatin/.konan/dependencies
e: java.lang.RuntimeException: Cannot extract archive with dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz.
> Task :shared:compileKotlinIosX64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:compileKotlinIosX64'.
> Compilation finished with errors
* 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 7s
1 actionable task: 1 executed
Command PhaseScriptExecution failed with a nonzero exit code ```
[![enter image description here][3]][3]
I reached out to community for this and finally found the solution. Here is the link to that issue which I raised and solved this problem.
If anyone else is going through this same issue it mostly cause of corrupted kotlin file.
Also try checking your cmd line tools in XCode as per comments.
Hope this helps someone. Cheers.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

Dartweb Webstorm, 502 Bad Gateway

While running the Get Started guide for Dart and using WebStorm as per the docs, Dartium window shows "502 Bad Gateway" when trying to run index.html for the first time.
When inspecting the IDE, the Pub Serve console shows an error while trying to run % .../pub serve web --port=<port>:
No pubspec.lock file found, please run "pub get" first
I went into my get_started project folder on the terminal and ran the same pub serve command and got the same error.
I am running WebStorm 2016.3.2 and Dart sdk 1.21.0 on Linux x64.
What is the proper procedure to follow here?
WebStorm IDE has been known to have this bug where it fails to run pub get on a project which will cause failures when trying to run the project.
To verify if this is occurring, go into the IDE and check for a Pub Serve warnings message at the bottom of the window. If you see the errors outlined in the OP, then this solution should work.
The problem without running pub get is that the project dependencies have not been resolved and thus the server cannot start.
In the IDE, check the project root for a file pubspec.yaml. Right click the file and select Pub: Get Dependencies. Check the Messages window to follow for the progress. If it finishes ok, the problem should be corrected.
Alternatively, you could run pub get manually from command line as you would do without an IDE.
[Update] The Dart team has updated the documentation to guide users on this issue: https://kw-webdev-dartlang-1.firebaseapp.com/guides/get-started (Pull request #329)

DartEditor: Pub build crashing

After clicking "Pub build" menu item in an empty project with sample code, a window pops up: "dart.exe is not working any more". The editor doesn't crash actually, despite of this notification. The console output is:
--- 11:47:17 Running pub build ... ---
Pub build failed, [-1073741819] You don't have a lockfile, so we need to generate that:
Resolving dependencies...Error WSAIoctl failed: 10022
....
Downloading browser 0.10.0+1...
Error WSAIoctl failed: 10022
Nothing gets built (operation gets aborted automatically). Anyone having this issue too? Any solution? Is it a bug?
Specs: Win 7, x86, DartEditor 1.2.0
The same problem appeared to me after an automatic update from 1.3.6. to 1.4.0.
A complete reinstall of Dart + Editor from the ZIP file solved the problem.

Is there a workaround for pub dependency resolution through proxies?

I'm trying to play with https://github.com/dart-lang/web-ui-code-lab for dart development. If I follow the pdf and open step05, then try to run chat_server.dart, I get this error (my path has no spaces in it, in case that's relevant):
dart --enable-checked-mode bin/chat_server.dart
Unable to open file: path/to/web-ui-code-lab-master/step05/bin/packages/dart_chat/file_logger.dart'file:///path/to/dart/web-ui-code-lab-master/step05/bin/chat_server.dart': Error: line 5 pos 1: library handler failed
import 'package:dart_chat/file_logger.dart' as log;
^
I presume this means that there are some missing dependencies, but I can't run pub install because I'm behind a corporate http proxy:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "web_ui 0.2.8+6" at http://pub.dartlang.org.
Hence, I started looking for a temporary workaround for pub dependency resolution. I tried changing the pubspec.yaml to go through the git:// protocol instead of http (which won't resolve without going through the proxy):
name: dart_chat
description: This is a chat app written in Dart using the Dart Web UI package
dependencies:
web_ui:
git: git://github.com/dart-lang/web-ui.git
I get further than before with pub install, so I think it successfully went through the git protocol and is trying to resolve web_ui's dependencies, but unfortunately doing so fails on web_ui's dependency for logging (which looks like it's still going through http://):
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "logging 0.2.7" at http://pub.dartlang.org.
It looks like I can't change the yaml to use the sdk's logging dependency either:
logging:
sdk: logging
because that's an incompatible source with web_ui:
Pub install failed, [1] Resolving dependencies...
Incompatible dependencies on 'logging':
- 'dart_chat' depends on it from source 'sdk'
- 'web_ui' depends on it from source 'hosted'
Is there any other way to get around this proxy issue with the current dev tools? Could I mirror pub.dartlang.org somehow? Or mirror the git repositories for each dependency? Thanks.
You said that you're using a Mac. If it's a laptop, why don't you try doing it from home? I'll notify the author of pub about this issue to see if he has any suggestions.
Currently there is no way to set a proxy in the Dart Editor, you can star this issue to check when it will be available.
I found a workaround to run the Pub install/update behind a proxy: in Windows, you can acess the "Environment variables" and add a variable named HTTP_PROXY with the value
https://USER:PASSWORD#my.proxy.adress:PORT

Resources