I'm using travis to test my code. Recently the grunt tasks have started to fail without no change being made to anything involved with grunt. (The new commit which is tested contains just very minor changes in two PHP files.)
Here is the part of log from travis:
$ grunt build:app
Running "typings:default" (typings) task
Warning: Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register")("bluebird") on application load prior to any require("any-promise"). Use --force to continue.
Aborted due to warnings.
The command "grunt build:app" exited with 3.
I tried to search for that warning message but couldn't find anything useful.
One more thing: When I run grunt build:app locally on my pc it works just fine.
Thanks for your time :)
I had the same problem when I started using grunt-typings. Worked locally and didn't work on my CI server. Ended up fixing it by doing what the error message suggests:
npm install bluebird
npm install any-promise
In GruntFile.js:
require("any-promise/register")("bluebird");
Update your node.js version to >v0.12. To check your version of node.js use node -v. The documentation of any-promise explains:
Node.js versions prior to v0.12 may have contained buggy versions of the global Promise. For this reason, the global Promise is not loaded automatically for these old versions. If using any-promise in Node.js versions versions <= v0.12, the user should register a desired implementation.
Related
I am trying to run my emulator after adding the firebase and google sign in plug ins/dependencies to my gradle.build files and now I am receiving the error
"Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0"
anyone know if I am doing something wrong this is a react native firebase app.
I am not sure what to try. This is my first app I am doing for a project at school and I do not really know what I am doing. I have just been following tutorials online
Solve this issue by deleting the .gradle folder from <NameOfProject>/android and again run npm run android
I think I just had this same problem. I don't have any idea what your error logs are though so I am not certain however this is my error log right here:
`> Task :react-native-gradle-plugin:compileKotlin FAILED
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm targeta version. 1 actionable task: 1 executed`
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'. Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRun Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilat
This error however I fixed by editing the gradle-wrapper.properties file's distributionUrl variable. I changed the distributionUrls gradle version to 7.4.2 the file is in Project-Name\android\gradle\wrapper\gradle-wrapper.properties
My error log is saying that gradle's version of JVM want's to be version 11 and is not but you can check gradle's jvm version by using cd android in the project root directory and after that run ./gradlew --version Change JVM's version from the version it is showing to the version that it says is required like in my case v 11. The way I changed gradle's JVM version required chocolatey which is a package manager. This is where you can require it https://chocolatey.org/install and after you have setup chocolatey open a new terminal that has administrative privileges and run this choco install -y nodejs-lts openjdk11 with the JVM version it is asking for inside your error logs
and finally run npm start and after that npm run android inside a refreshed and new terminal and gradle's JVM version and gradle's version will be updated to the specified versions
We could better help if you could you show us your android/build.gradle and android/app/build.gradle files, but here are more specific instructions than you find in the docs:
In android/build.gradle, dependencies should look something like this:
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath("com.android.tools.build:gradle:<version>")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:<version>")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/build.gradle
It is known this works with the classpaths at the beginning.
--
Also in android/app/build.gradle, it is known that the google-services dep works at the end of the file.
apply plugin: 'com.google.gms.google-services'
and make this the last "implementation" under dependencies (around line 272)
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' // <-- add this; newer versions should work too
see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/app/build.gradle
Then, delete android/.gradle and run npx react-native run-android in the root directory.
I am building the Visual Studio Code from the source checked out from the git repository:
git clone https://github.com/microsoft/vscode
I am building using:
export NODE_OPTIONS=--max_old_space_size=2048
./scripts/npm.sh install --arch=armhf
./scripts/code.sh
I am using node 10.16.3 on a Raspberry PI 4, using Raspbian buster
There were no errors during build.
The installation downloads a precompiled version of electron on the first run.
However each time I try and run code, it starts but with an error:
[storage state.vscdb] open(): Unable to open DB due to Error: Cannot find module '../build/Release/sqlite
If I look in node_modules/vscode-sqlite3/build/Release/
I can see:
sqlite3.a
sqlite.a
It is unclear to me why electron/vscode cannot find this library. I would be greatful for any pointers on how to tell the runtime where to look for the modules.
On inspecting the build scripts and after many painful experiments, I've found and solved the 2 problems leading to this error.
The fact that .a static libraries are left behind hinted that some settings in the binding.gyp, config.gpy and/or makefiles are wrong, as Native Node Modules are normally dynamic libraries with an .node extension. One conditional line in the binding.gyp file under vscode-sqlite3 seems to the the culprit:
...
["target_arch=='arm'", {"type": "static_library"}]
...
Disable that line (by removing it or changing 'arm' to something else) and then run:
node-gyp configure
to regenerate the config.gpy file(s) under the build directory. Then build the module with:
node-gyp build
A sqlite.node will be generated in build/Release.
Unfortunately, the latest electron ABI version rarely matches that of the Node.js version. In my configuration, the electron ABI version is 72 (v6.0.12) but the latest stable Node version is for ABI 64. Therefore we have to do an electron-rebuild to update the sqlite.node to match the electron version.
To do this, you would have to first install electron-rebuild (yarn add electron-rebuild) then run electron-rebuild by giving supplying explicitly the version number of the electron binary that vscode downloaded:
electron-rebuild -v 6.0.12 -m /home/dev/vscode -o vscode-sqlite3
Of course you would have to state the version number of your particular version of electron you are building for.
(Please look up electron-rebuild --help for the meaning of the options. It takes a while to rebuild the binary module...)
The resulting sqlite.node can then be moved into the build/Release/. directory under the vscode project directory. Voila, we have a working latest version VS-Code for Raspbian!
I have the latest PhpStorm (2016.2) and PHPUnit phar (5.5.4). For some reason when I run a PHPUnit test in my project in PhpStorm, it is adding on --teamcity to the run command, resulting in a failure:
Testing started at 12:52 PM ...
Unit test suite invoked with a path to a non-unit test: --teamcity
Process finished with exit code 1
I have no idea where this --teamcity option is coming from, it happens no matter what test I run, and even when starting from a blank configuration. I also do NOT have the TeamCity plugin installed, I don't even use TeamCity.
Here's what the full command appears as:
/usr/local/Cellar/php70/7.0.9/bin/php /Users/name/bin/phpunit-5.5.4.phar --configuration /path/to/config/my-phpunit.xml ClassNameTest /Users/name/PhpstormProjects/path/to/tests/unit/app/ClassNameTest.php --teamcity
(sensitive information swapped out)
All I want to do is get rid of this --teamcity option, everything works if I run in a separate terminal window without that option. This only recently started happening, maybe after a PhpStorm update.
tl;dr
I only could resolve this by removing the system installed phpunit instance from my system (Linux):
sudo apt remove phpunit-*
Details
Even if the setting in PhpStorm was to use composer autoloader:
for some reason it ended up using TeamCity from /usr/share/php/PHPUnit/Util/Log/TeamCity.php:
Project's local PHPUnit was 6.2 while the system default was 5.1 -> they're incompatible.
I spent half a day struggling with this. The underlying issue is switching between PHPUnit versions (6.x.x -> 4.x.x). (Happened to me by switching branches)
A click on the refresh button in the PHPUnit preferences fixes it.
(Languages & Frameworks > PHP > PHPUnit)
Make sure the version of PHPUnit it thinks you have matches the one it reports.
This --teamcity option is used by PHPStorm to output tests result.
What you're facing is an issue caused by PHP7 and an old version of PHPUnit.
Remove your PHPUnit 5 and install the latest one (currently 6.2) with composer and use PHPUnit namespaces instead.
More info on this bug: https://github.com/sebastianbergmann/phpunit/issues/2460
Problem was internal to the project. PHPUnit does not contain that error message. Sorry!
I've installed both the grunt-cli and grunt globally using the -g option.
However when I try and run grunt I get this error:
grunt --gruntfile /Users/a/root/config/Gruntfile.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
This is confusing as it seems to say that you are suppose to do a local install.
It seems contradictory actually. I clearly have a grunt file in place.
Grunt-cli is installed globally so that the grunt command is available to be run from any location on your system. Without the global installation, you would need to rely on somewhat abstract methods of running local grunt installs (npm run-script and friends), which are clunky for this use.
The entire point of the global install is only to load and run a local Gruntfile.js using the locally installed version of Grunt. The error message indicates this:
either a Gruntfile wasn't found or grunt hasn't been installed locally to your project.
In other words, to run Grunt, you need to create a Gruntfile.js and you must have a local copy of Grunt installed to your project alongside the file. The CLI is just there to kick off the process without troublesome fiddling.
I'm pretty new to whole Grunt and SCSS workflow stuff and recently configured Grunt with a WP theme development that run under MAMP. Installation of Node, NPM, Grunt and its dependencies went smooth. However, when i make a change on .SCSS files, it doesn't seem to be reflecting the changes to the .CSS files due to following warning from compass:
Running "compass:app" (compass) task
LoadError on line ["55"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- susy
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.
Aborted due to warnings.
Not exactly sure what's up but obviously a communication issue between Ruby and Compass?
Whether it be incorrect version mapping or paths..?
I researched and attempted following:
Uninstalled the current and installed new Ruby
Installed RVM (didn't use it, just installed it)
Upgraded compass to the latest version 0.12.2 and made sure this version is reflected in package.json for grunt.
Any pointers and advise highly appreciated!
I don't know if this is an option but you might look at PrePros (https://github.com/sbspk/Prepros). I tried for a while to setup the raw/core setup you are working with but it was just always quirky - not to mention super tedious to setup. PrePros takes all the pain away! Just a suggestion.
Related/Reference link: https://stackoverflow.com/questions/19866550/sass-haml-compile-on-prepros