React Native Firebase Android always crash 0.61 - firebase

Issue
I tried to add the react-native-firebase library https://github.com/invertase/react-native-firebase and everything works perfectly on iOS. When it comes to integration on android, nothing works.
The project Builds correctly, but the app crashes (only in Android) right after the build with this output:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1099 file(s) to forward-jetify. Using 16 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Configure project :#react-native-firebase_analytics
:#react-native-firebase_analytics:firebase.bom using default value: 21.1.0
:#react-native-firebase_analytics package.json found at /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/#react-native-firebase/analytics/package.json
:#react-native-firebase_analytics:version set from package.json: 6.0.3 (6,0,3 - 6000003)
:#react-native-firebase_analytics:android.compileSdk using custom value: 28:#react-native-firebase_analytics:android.targetSdk using custom value: 28
:#react-native-firebase_analytics:android.minSdk using custom value: 16
:#react-native-firebase_analytics:reactNativeAndroidDir /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/react-native/android
> Configure project :#react-native-firebase_app
:#react-native-firebase_app:firebase.bom using default value: 21.1.0
:#react-native-firebase_app package.json found at /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/#react-native-firebase/app/package.json
:#react-native-firebase_app:version set from package.json: 6.0.3 (6,0,3 - 6000003)
:#react-native-firebase_app:android.compileSdk using custom value: 28
:#react-native-firebase_app:android.targetSdk using custom value: 28
:#react-native-firebase_app:android.minSdk using custom value: 16
:#react-native-firebase_app:reactNativeAndroidDir /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/react-native/android
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:processDebugGoogleServices
Parsing json file: /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/android/app/google-services.j
son
> Task :app:installDebug
12:49:58 V/ddms: execute: running am get-config
12:49:58 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
12:49:58 V/ddms: execute: returning
Installing APK 'app-debug.apk' on '3.7_WVGA_Nexus_One_API_28(AVD) - 9' for app:debug
12:49:58 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
12:49:58 D/Device: Uploading file onto device 'emulator-5554'
12:49:58 D/ddms: Reading file permision of /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
12:49:59 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
12:50:02 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : E
OF hit. Read: -1
12:50:02 V/ddms: execute: returning
12:50:02 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
12:50:02 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read:
-1
12:50:02 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 7s
192 actionable tasks: 3 executed, 189 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.halfy_app/.MainActivity }
MBP-di-Enzo:halfy_app enzomanuelmangano$
MBP-di-Enzo:halfy_app enzomanuelmangano$ react-native run-android --log
error: unknown option `--log'
MBP-di-Enzo:halfy_app enzomanuelmangano$ react-native run-android -log
error: unknown option `-l'
MBP-di-Enzo:halfy_app enzomanuelmangano$ react-native run-android
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-maps (to unlink run: "react-native unlink react-native-maps")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1099 file(s) to forward-jetify. Using 16 workers...
info JS server already running.
info Installing the app...
> Configure project :#react-native-firebase_analytics
:#react-native-firebase_analytics:firebase.bom using default value: 21.1.0
:#react-native-firebase_analytics package.json found at /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/#react-native-firebase/analytics/package.json
:#react-native-firebase_analytics:version set from package.json: 6.0.3 (6,0,3 - 6000003)
:#react-native-firebase_analytics:android.compileSdk using custom value: 28
:#react-native-firebase_analytics:android.targetSdk using custom value: 28
:#react-native-firebase_analytics:android.minSdk using custom value: 16
:#react-native-firebase_analytics:reactNativeAndroidDir /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/react-native/android
> Configure project :#react-native-firebase_app
:#react-native-firebase_app:firebase.bom using default value: 21.1.0
:#react-native-firebase_app package.json found at /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/#react-native-firebase/app/package.json
:#react-native-firebase_app:version set from package.json: 6.0.3 (6,0,3 - 6000003)
:#react-native-firebase_app:android.compileSdk using custom value: 28
:#react-native-firebase_app:android.targetSdk using custom value: 28
:#react-native-firebase_app:android.minSdk using custom value: 16
:#react-native-firebase_app:reactNativeAndroidDir /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/node_modules/react-native/android
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:processDebugGoogleServices
Parsing json file: /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/android/app/google-services.j
son
> Task :app:installDebug
12:51:39 V/ddms: execute: running am get-config
12:51:39 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
12:51:39 V/ddms: execute: returning
Installing APK 'app-debug.apk' on '3.7_WVGA_Nexus_One_API_28(AVD) - 9' for app:debug
12:51:39 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
12:51:39 D/Device: Uploading file onto device 'emulator-5554'
12:51:39 D/ddms: Reading file permision of /Users/enzomanuelmangano/Desktop/Lavoro/halfy_app/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
12:51:39 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
12:51:40 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read:
12:51:40 V/ddms: execute: returning
12:51:40 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
12:51:40 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
12:51:40 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 4s
192 actionable tasks: 3 executed, 189 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.halfy_app/.MainActivity }
Android
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 22
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
playServicesVersion = "17.0.0"
androidMapsUtilsVersion = "0.5+"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { url 'https://jitpack.io' }
}
}
android/app/build.gradle
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.halfy_app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'FontAwesome.ttf' ] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
React Native Version: 0.61

I solved that problem erasing that code in android/app/build.gradle
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'

Related

When i run npm run watch, i get TypeError: The 'compilation' argument must be an instance of Compilation, does anyone know why?

I am currently working on a website using symfony and i use webpack to compile the CSS and JS. When i try npm run watch, i get the following :
TypeError: The 'compilation' argument must be an instance of Compilation
at Function.getCompilationHooks (C:\Users\Louis\desktop\NEWPLANTE-2\node_modules\webpack\lib\NormalModule.js:227:10)
at C:\Users\Louis\desktop\NEWPLANTE-2\node_modules\#symfony\webpack-encore\lib\webpack-manifest-plugin\index.js:56:24
at _next46 (eval at create (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:50:1)
at _next24 (eval at create (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:97:1)
at _next2 (eval at create (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:144:1)
at Hook.eval [as call] (eval at create (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:152:1)
at Hook.CALL_DELEGATE [as _call] (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\webpack\lib\Compiler.js:1122:26)
at C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\webpack\lib\Compiler.js:1166:29
at Hook.eval [as callAsync] (eval at create (C:\Users\Louis\Desktop\NEWPLANTE-2\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
I already checked, webpack is installed only once so there is no duplicate.
I tried several times deleting package.json, package-lock.json and node_modules and re running npm install But i still got the same error when running npm run watch.
Node and npm are already up to date so it should not be an update problem.
PS C:\Users\Louis\desktop\NEWPLANTE-2> npm -v
8.13.2
PS C:\Users\Louis\desktop\NEWPLANTE-2> node -v
v16.14.2
Here is the content of my package.json file
{
"devDependencies": {
"#hotwired/stimulus": "^3.0.0",
"#symfony/stimulus-bridge": "^3.0.0",
"#symfony/webpack-encore": "^1.8.1",
"core-js": "^3.0.0",
"regenerator-runtime": "^0.13.2",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
}
Im not the only member in this project, i have checked with my teammates, the npm run watch is working for them. I am not sure why mine is not working although we have the same code and the same files.
Here is the content of webpack.config.js
const Encore = require("#symfony/webpack-encore");
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || "dev");
}
Encore
// directory where compiled assets will be stored
.setOutputPath("public/build/")
// public path used by the web server to access the output path
.setPublicPath("/build")
// only needed for CDN's or sub-directory deploy
//.setManifestKeyPrefix('build/')
/*
* ENTRY CONFIG
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry("app", "./assets/app.js")
.addEntry("homepage", "./assets/homepage.js")
.addEntry("about", "./assets/about.js")
.addEntry("annonce", "./assets/annonce.js")
.addEntry("contact", "./assets/contact.js")
.addEntry("faq", "./assets/faq.js")
.addEntry("mentions", "./assets/mentions.js")
.addEntry("signup", "./assets/signup.js")
.addEntry("profil", "./assets/profil.js")
.addEntry("createAnnonce", "./assets/createAnnonce.js")
.addEntry("signup2", "./assets/signup2.js")
.addEntry("validation", "./assets/validation.js")
.addEntry("cgu", "./assets/cgu.js")
.addEntry("error404", "./assets/error404.js")
.addEntry("login", "./assets/login.js")
.addEntry("payment", "./assets/payment.js")
.addEntry("recap", "./assets/recap.js")
.addEntry("verify", "./assets/verify.js")
.addEntry("errors", "./assets/errors.js")
// .splitEntryChunks()
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
.enableStimulusBridge("./assets/controllers.json")
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
/*
* FEATURE CONFIG
*
* Enable & configure other features below. For a full
* list of features, see:
* https://symfony.com/doc/current/frontend.html#adding-more-features
*/
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
.configureBabel((config) => {
config.plugins.push("#babel/plugin-proposal-class-properties");
})
// enables #babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = "usage";
config.corejs = 3;
});
// enables Sass/SCSS support
//.enableSassLoader()
// uncomment if you use TypeScript
//.enableTypeScriptLoader()
// uncomment if you use React
//.enableReactPreset()
// uncomment to get integrity="..." attributes on your script & link tags
// requires WebpackEncoreBundle 1.4 or higher
//.enableIntegrityHashes(Encore.isProduction())
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()
module.exports = Encore.getWebpackConfig();

SBT terminates silently when Git repository for build plugin can't be downloaded

SBT is silently failing when it can't download a plugin via SSH from a Git repository.
This is the output of SBT when it's trying to download the repository:
[info] Updating ProjectRef(uri("ssh://git#repository.com/plugin.git"), "plugin")...
# (nothing after that line)
And it just terminates after that with no explanation. This is very likely a bug with SBT's downloading of plugins via SSH from a Git repository.
When downloading the plugin succeeds, this line is printed:
[info] Done updating.
So for some reason, SBT isn't stating what's wrong, even when executed like this:
sbt -Xdebug test
Here are the relevant configuration files:
# project/build-properties
sbt.version=1.1.5
# project/plugins.sbt
lazy val buildPlugin = RootProject(uri("ssh://git#repository.com/plugin.git"))
lazy val root = (project in file(".")).dependsOn(buildPlugin)
Questions:
1. How can I get SBT to print more debugging information?
2. Where in the SBT code could I fix this bug?
3. How can I build and use my own version of SBT?
How can I get SBT to print more debugging information?
Using the latest launching script available from https://www.scala-sbt.org/download.html (1.2.1 as of August, 2018), you can run:
$ sbt -debug
Where in the SBT code could I fix this bug?
See my answer here https://github.com/sbt/sbt/issues/1120#issuecomment-415553592:
Here are some of the relevant code:
Load.builtinLoader - https://github.com/sbt/sbt/blob/v1.2.1/main/src/main/scala/sbt/internal/Load.scala#L480-L488
RetrieveUnit - https://github.com/sbt/sbt/blob/v1.2.1/main/src/main/scala/sbt/internal/RetrieveUnit.scala
Resolvers.git - https://github.com/sbt/sbt/blob/v1.2.1/main/src/main/scala/sbt/Resolvers.scala#L82-L101
Resolvers.creates - https://github.com/sbt/sbt/blob/v1.2.1/main/src/main/scala/sbt/Resolvers.scala#L145-L155
val git: Resolver = (info: ResolveInfo) => {
val uri = info.uri.withoutMarkerScheme
val localCopy = uniqueSubdirectoryFor(uri.copy(scheme = "git"), in = info.staging)
val from = uri.withoutFragment.toASCIIString
if (uri.hasFragment) {
val branch = uri.getFragment
Some { () =>
creates(localCopy) {
run("git", "clone", from, localCopy.getAbsolutePath)
run(Some(localCopy), "git", "checkout", "-q", branch)
}
}
} else
Some { () =>
creates(localCopy) {
run("git", "clone", "--depth", "1", from, localCopy.getAbsolutePath)
}
}
}
....
def creates(file: File)(f: => Unit) = {
if (!file.exists)
try {
f
} catch {
case NonFatal(e) =>
IO.delete(file)
throw e
}
file
}
How can I build and use my own version of SBT?
https://github.com/sbt/sbt/blob/1.x/CONTRIBUTING.md#build-from-source
For this, you just need sbt/sbt, and publishLocal.

Jenkins - Symfony with environment variables

I've been struggling in building automated build using Jenkins with symfony 3.4.
How to properly set environment variables in Jenkins that symfony can find it.
here's my pipeline.
node {
def app
stage('composer install') {
sh 'export $(cat env/env_vars | xargs)'
sh 'composer install --optimize-autoloader'
}
stage('yarn install') {
sh 'yarn install'
}
stage ('build assets') {
sh 'yarn encore production'
}
stage('Clone repository') {
// clone
}
stage('Build image') {
// build here
}
stage('Push image') {
// push here
}
}
then after I run my build.
I always got this message
....
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_host ('%env(DATABASE_HOST)%'): Script Incenteev\ParameterHandler
\ScriptHandler::buildParameters handling the symfony-scripts event terminated with an exception
[Symfony\Component\Console\Exception\RuntimeException]
Aborted
....
I already used some jenkins plugin like EnvInjector and something similar. But still symfony can't find my environment variables.
You can probably solve this like this:
stage('composer install') {
sh 'export $(cat env/env_vars | xargs) && composer install --optimize-autoloader'
}
This will make the environment variables available in the same shell session.

Angular 5 autocomplete geolocation npm install not working

In my Angular 5 project I want to implement google autocomplete geolocation.
I got some reference of npm modules:-
https://www.npmjs.com/package/ng4-geoautocomplete
https://www.npmjs.com/package/ngx-google-places-autocomplete
According to their guidance when I am going to install that module I am facing some warning:
Installation command:-
npm install --save ng4-geoautocomplete
Warnings:-
***npm WARN ngx-slideshow#0.1.0 requires a peer of #angular/core#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-slideshow#0.1.0 requires a peer of #angular/common#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng4-geoautocomplete#0.1.0 requires a peer of #angular/core#>=2.0.0 <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ ng4-geoautocomplete#0.1.0
added 68 packages in 96.971s***
My project version:-
Angular CLI: 1.7.4
Node: 8.9.3
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
#angular/cli: 1.7.4
#angular-devkit/build-optimizer: 0.3.2
#angular-devkit/core: 0.3.2
#angular-devkit/schematics: 0.3.2
#ngtools/json-schema: 1.2.0
#ngtools/webpack: 1.10.2
#schematics/angular: 0.3.2
#schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
Why I am facing this problem and what will be the solution?
Is there any other way to implement google autocomplete geolocation?
Yes.
npm install #agm/core --save-dev
npm install #types/googlemaps --save-dev
app.module.ts
import {AgmCoreModule} from '#agm/core'
.
.
.
imports: [
.
.
.
AgmCoreModule.forRoot({
apiKey: 'your api key',
libraries: ['places']
}),
.
.
.
]
in your html
<div>
<input type="text" placeholder="Search for location" autocorrect="off" name="" spellcheck="off" #autoSearch/>
</div>
component.ts file
import {Component, ViewChild, ElementRef, NgZone, OnInit} from '#angular/core'
import { MapsAPILoader } from '#agm/core';
import {} from #types/googlepmaps;
.
.
.
export class YourComponent implements OnInit {
#ViewChild('autoSearch') public searchElement: ElementRef;
consturctor (private mapsAPILoader: MapsAPILoader , private ngZone : NgZone )
{}
ngOnInit() {
this.mapsAPILoader.load().then(
() => {
let autocomplete = new
google.maps.places.Autocomplete(this.searchElement.nativeElement,
{types:["address"]});
autocomplete.addListener("place_changed", ()=> {
this.ngZone.run(()=>{
let place: google.maps.places.PlaceResult =
autocomplete.getPlace();
if(place.geometry === undefined || place.geometry === null) {
return;
}
})
})
}
);
}
}
I rather use the AGM library rather than just the autocomplete that you are using because the autocomplete only gives you autcomplete fucntionalty whether the AGM can be use to render the google maps with the markers.
Now,
to install dependencies yourself to fix your warnings you can reference to this stackoverflow question: How to install npm peer dependencies automatically?

Meteor deploy with node-prerender failed

I would like deploy my Meteor APP with node-prerender but it failed on 'Verifying Deployment' with mup.
I've not any error, just failed :
- Verifying Deployment
[ [xx.xxx.xxx.xxx] x Verifying Deployment: FAILED
-----------------------------------STDERR-----------------------------------
ib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build'
bcrypt#0.8.7 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt
bindings#1.2.1 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bindings
nan#2.3.5 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/nan
> buffertools#2.1.4 install /bundle/bundle/programs/server/npm/node_modules/bufferstream/node_modules/buffertools
> node-gyp rebuild
make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bufferstream/node_modules/buffertools/build'
CXX(target) Release/obj.target/buffertools/buffertools.o
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
----------------------------------------------------------------------------
If i test to deploy my APP without node-prerender, it work nice.
I'm based on this blog post.
My JS call in server :
Meteor.startup(() => {
const prerenderio = Npm.require('prerender-node');
const settings = Meteor.settings.private.PrerenderIO;
if (settings && settings.token && settings.host) {
prerenderio.set('prerenderToken', settings.token);
prerenderio.set('host', settings.host);
prerenderio.set('protocol', 'http');
WebApp.rawConnectHandlers.use(prerenderio);
}
});
I've not error on local.
Do you have any idea ?
Thank you !

Resources