Gradle Building Failure & Flutter - dart

I've been struggling with this problem, ofc I googled it but I am out of options. I re-installed Android Studio and Flutter SDK but no work. But I can start from scratch if you write the steps maybe I forgot something, I am not sure spending 4 hours with this I think I lost my mind.
* Error running Gradle:
ProcessException: Process "D:\flutter-workspace\test1\test1\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error: Could not find or load main class org.gradle.launcher.daemon.bootstrap.GradleDaemon
Picked up _JAVA_OPTIONS: -Xmx1536M
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
Picked up _JAVA_OPTIONS: -Xmx1536M
Command: D:\flutter-workspace\test1\test1\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
gradle-wrapper.properties
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
build.gradle
(the important part I think)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
gradle.properties
org.gradle.jvmargs=-Xmx1536M
.iml
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/app/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/app/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/app/src/main/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/app/src/main/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/app/src/main/proguard_logs" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
</module>

For people who are having this problem and couldn't find any solution yet, I had a username with non-English character and with whitespace, the place I bought my computer gave the username and without format (changing the user name I mean) it may confuse the register.

Related

How to run Dart tests in IntelliJ with NNBD experiment enabled?

I am on Dart 2.10.0-92.0.dev and I am trying to port my libraries to use null-saftey / non-nullable / NNBD.
I've enabled the experiment in analysis_options.yaml and the analyzer in IntelliJ is correctly displaying errors and warning.
I can successfully run tests from the command line, and in IntelliJ using a Dart Command Line App by passing --enable-experiment=non-nullable as a VM option.
It is unclear to me how I can run a Dart Test in IntelliJ? I keep on getting the following error, and I can't figure out how to pass the experiment flag?
Error: This requires the null safety language feature, which is experimental.
You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
Today's Dart plugin update adds 'VM Options' field to the Dart Test run configuration. Click Help -> Check for Updates... in the IDE to get it.
What you need to do it's to put --enable-experiment=non-nullable in the VM options while Editing the configuration:
To run Dart tests configuration with NNBD enabled, you need to add the VMOptions in the "run configuration" file :
Check the "Store as project file" options in the "Edit configuration" window,
Open the generated configuration file ( YOUR_PROJECT/.idea/runConfigurations/YOUR_RUN_TEST.xml ) and add this line before the filePath option :
<option name="VMOptions" value="--enable-experiment=non-nullable --no-sound-null-safety" />
Your file should look like :
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="my tests" type="DartTestRunConfigurationType" factoryName="Dart Test" nameIsGenerated="true">
<option name="VMOptions" value="--enable-experiment=non-nullable --no-sound-null-safety" />
<option name="filePath" value="$PROJECT_DIR$/srv/ytbx021-run-api/app" />
<option name="scope" value="FOLDER" />
<method v="2" />
</configuration>
</component>
Then run your tests, it will fail one more time, but on the next run it should run in null safety mode.

Aspnet Core Azure Failing with HTTP Error 502.5 - Process Failure

I am trying to deploy an aspnet core app to Azure. This seems to have gone through OK but when I try to start up the app I am presented with the following error...
Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process’ stdout messages
Attach a debugger to the application process and inspect
There seems to be much written about IIS in this but not with Azure so I'm at a loss as to where to look next. The Azure logs are not indicating anything.
The Microsoft docs give me this info...
Platform conflicts with RID
Browser: HTTP Error 502.5 - Process Failure
Application Log: - Application Error: Faulting module: KERNELBASE.dll
Exception code: 0xe0434352 Faulting module path:
C:\WINDOWS\system32\KERNELBASE.dll - IIS AspNetCore Module: Failed to
start process with commandline '"dotnet" .\my_application.dll'
(portable app) or '"PATH\my_application.exe"' (self-contained app),
ErrorCode = '0x80004005'.
ASP.NET Core Module Log: Unhandled Exception:
System.BadImageFormatException: Could not load file or assembly
'teststandalone.dll' or one of its dependencies. An attempt was made
to load a program with an incorrect format.
Troubleshooting:
If you published a self-contained application, confirm that you didn't
set a platform in buildOptions of project.json that conflicts with the
publishing RID. For example, do not specify a platform of x86 and
publish with an RID of win81-x64 (dotnet publish -c Release -r
win81-x64). The project will publish without warning or error but fail
with the above logged exceptions on the server.
...but don't actually help by telling me what these settings should be for Azure (or if it's relevant there) so I'm not sure if this is a red herring. I'm not specifying a -r switch on my dotnet publish configuration.
I managed to find an event log which threw out some XML repeatedly logging...
Failed to start process with commandline '"%LAUNCHER_PATH%"
%LAUNCHER_ARGS%', ErrorCode = '0x80070002'.
After more investigation I discovered that I needed to change the %LAUNCHER_PATH% and %LAUNCHER_ARGS% values myself. I've tried various changes to the web.config but no luck. My web.config now looks like this...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="dotnet" arguments="site\wwwroot\Esoterix.Modle.Portalweb.dll" stdoutLogEnabled="true" stdoutLogFile="LogFiles\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
The paths are from the root of the Azure deployment which seems to work for the stdout log file path (I was getting errors reported with that) but not for the app itself. I'm still seeing the following error..
<Event>
<System>
<Provider Name="IIS AspNetCore Module"/>
<EventID>1000</EventID>
<Level>0</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2016-11-28T19:31:32Z"/>
<EventRecordID>1514022203</EventRecordID>
<Channel>Application</Channel>
<Computer>RD0004FFD7108D</Computer>
<Security/>
</System>
<EventData>
<Data>Failed to start process with commandline '"dotnet" site\wwwroot\Esoterix.Modle.Portalweb.dll', ErrorCode = '0x80004005'.</Data>
</EventData>
</Event>
Which is repeated 4 times
If I look in my stdout output I have the following...
Failed to load the dll from [\?\D:\home\site\wwwroot\hostpolicy.dll],
HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll from
[\?\D:\home\site\wwwroot]
If I try running the exe directly with the web config here...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="\\?\%home%\site\wwwroot\Esoterix.Modle.Portalweb.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
Then my stdout gives me the following error...
Failed to load the dll from [\?\D:\home\site\wwwroot\hostfxr.dll],
HRESULT: 0x80070057
The library hostfxr.dll was found, but loading it from
\?\D:\home\site\wwwroot\hostfxr.dll failed
Installing .NET Core prerequisites might help resolve this problem.
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
I resolved this by adding a reference to dotnet-publish-iis.
Full details on how to do this are logged in a github issue at https://github.com/aspnet/Hosting/issues/892

Web Config Transformed Multiple Times

I am using MSBuild command line to build and I used Configuration as Release but all configurations are applied. I am unable to find that what the issue could be.
I have three configurations
under Web.config
Web.Debug.config
Web.Live.config
Web.Release.config
I am using following command of MSBuild
"%MSBuildTools14.0_x64_Path%\MSBuild" %system.teamcity.build.workingDir%\Application\Application.csproj /p:VisualStudioVersion=14.0 /p:Configuration=Release /p:OutputPath=bin
Any Help would be appreciable !!
Edit : I have a node in web.config as
<connectionStrings configSource="Config\Sql.config" />
which I am overriding in Web.Release.config and Web.Live.Config as
<connectionStrings configSource="Config\Sql.Release.config" xdt:Transform="SetAttributes(configSource)" />
<connectionStrings configSource="Config\Sql.live.config" xdt:Transform="SetAttributes(configSource)" />
and I am getting Config\Sql.live.config in final Web.Config
So I think I am using configuration Release but all configurations are been used for transformation.
Please Help!

Missing Microsoft.Build.Tasks.v4.0.dll on visual studio online tfs build

I am trying to build my project with visual studio online.
I am getting the following error.
C:\a\src\.nuget\nuget.targets (71): The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.
This is coming from the nuget.targets file in my solution.
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<EnvKey ParameterType="System.String" Required="true" />
<EnvValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
}
catch {
}
]]>
</Code>
</Task>
</UsingTask>
I have updated nuget.exe to latest and have not changed anything in nuget.targets.
The problem was that some of the class libraries in the solution had the default value :
ToolsVersion="12.0"
changing that to
ToolsVersion="4.0"
made it work on TFS online
I ran into this after upgrading a project to .NET 4.5.2. Seems to be a conflict between the .NET 4.5 point releases and the old way to do NuGet package restore (MSBuild-Integrated package restore vs Automatic Package Restore).
I was able to solve the issue by migrating NuGet to the new way of doing package restore: http://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore
More info: http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

TF215097 Custom Build Activities using Com Interop on 64 bitsTF215097: An error occurred w

TF215097: An error occurred while initializing a build for build definition {DefinitionName}: The invocation of the constructor on type 'Classname' that matches the specified binding constraints threw an exception.
OK some had already answered this very well:
TFS 2010 Custom Build Activity TF215097 error
I had the same issue before and corrected them by adding the correct attribute:
Microsoft.TeamFoundation.Build.Client.BuildActivity( Microsoft.TeamFoundation.Build.Client.HostEnvironmentOption.Agent )
My build is running well on x86 machine but give the error on 64 bit build controller or agent.
The Context :
I created several Build Activities. One of this activity is a Visual Build Pro runner activity. I referenced the Visual Build Professional 6 Server Object. (We have several project and could not update it... at this point)
When I build the assembly VS 2010 generate Native.{MyAssemblyName}.manifest
<?xml version="1.0" encoding="utf-8"?>
<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity name="Native.EMI.TeamFoundation.Build" version="1.0.0.0" type="win32" />
<file name="VisBuildSvr.dll" asmv2:size="712904">
<hash xmlns="urn:schemas-microsoft-com:asm.v2">
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>aePKKx7BgE7vN7OjQqwrQ2bvex8=</dsig:DigestValue>
</hash>
<typelib tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" version="1.0" helpdir="C:\Program Files (x86)\VisBuildPro6\System\VisBuildPro.chm" resourceid="0" flags="HASDISKIMAGE" />
<comClass clsid="{d87ad38d-99d9-4e04-9505-696c3afde66c}" threadingModel="Both" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.Application" description="Visual Build Pro 6 server application component" />
<comClass clsid="{1cc058ff-793f-4560-9fad-48d88db93ca9}" threadingModel="Free" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.Builder" description="Visual Build core builder component (MTA)" />
<comClass clsid="{5ef3f30b-278b-4796-8f23-41fdd5ddc96c}" threadingModel="Both" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.BuilderSTA" description="Visual Build core builder component (MTA/STA)" />
</file>
</assembly>
And Interop.VisBuildSvr.dll assembly
When I trig a build on a Windows 64 bit Build Controller and Agent on the same machine I have the TF error.
I tried to attach the debugger on the controller and I am able to see the first error :
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: Could not load file or assembly 'Interop.VisBuildSvr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d64ea679b6fd0408' or one of its dependencies. The system cannot find the file specified.
That file is on my custom assemblies folder on TFS and also on the BuildController and BuildAgent folder.
Thanks
From your comment, it looks like you got it working by configuring your build to invoke the 32-bit version of MSBuild. Is that right?

Resources