Friday, July 27, 2018

How to solve in macOS High Sierra xcrun: error: invalid active developer path /Library/Developer/CommandLineTools

I was just trying in my friend computer downgrade her npm version from 9.5.0 to 8.11.3, and suddenly I had to face an error:

(xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools))

I didn't know that she hadn't installed Xcode CommandLine, so, this is the way to do that:

xcode-select --install

So, that's all. Good luck.

Thursday, June 7, 2018

How to set environment variables on MacOS?

There are two ways to set environment variables on MacOS (and I assumed is the same in linux):

1. Temporary
The easy and fast way to set an environment variable, and is perfect that tasks that required one of those.
export [VARIABLE_NAME]=[PATH]
Example:
export JAVA_HOME=/usr/libexec/java_home
Another example is when is required add a path to the PATH variable, without lost the current content:
export PATH=/THE/NEW/FOLDER/:$PATH
Unfortunately, is our terminal is closed, we lost the variables previously settled.

2. Permanently
If we need to keep the variables in a permanent way, we need not only use export command, but using on a file called .bash_profile. This file must be on the user folder, and normally it doesn't exist, so, we need to create it with our favorite editor, or using this command:
touch ~/.bash_profile
Inside this file we need to put all the path using export that we want:
export JAVA_HOME=/usr/libexec/java_home 
export PATH=/Users/username/Library/Android/sdk/platform-tools:$PATH
This file looks like:

That's all.

Sunday, January 14, 2018

Cannot load underlying module for 'SideMenu'

I'm implementing SideMenu pod in a Swift project using only code.

I did the basic setup installing the pod (I've already got cocoapod installed):

pod init
open -a Xcode Podfile

For me, the podfile configuration in the official page doesn't work, so, I made a little modification:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.2'
use_frameworks!

target 'SideMenuCodeImplementation' do
pod "SideMenu"

end

Where SideMenuCodeImplementation is my project name. Then, I execute the last command:

pod install

But, when I started the implementation, at trying import SideMenu, I only got the message

Cannot load underlying module for 'SideMenu'

The solution was simple: Clean (Shift+Command+K) and build (Command+B) the project.

That's all.

Saturday, December 30, 2017

Working with barcodeScanner and Camera plugins at the same cordova project

Recently, I had to put two plugins in a particular cordova (I suppose that phonegap can has a similar issue) project:
First of all, when we started an hybrid project, is a good practice make sure that every single plugin has been working from the beginning if we don't want a headache.

I tried different ways to work with those plugins, but the only way I could do it was using some specific versions of android platform and barcodeScanner plugin.

Android platform: 5.1.1
barcodeScanner: 0.7.0

Besides, I found (and I don't know why yet) that is highly recommended (by me :) ) to install the Camera plugin first than another one, because for some reason (weird reason actually), this plugin remove all the files project in the www folder, and reset it to the fabric android template.

So, in order to make a functional project with our plugins we have to do the next:
cordova create myproject
cd myproject/
cordova platform add android@5.1.1
cordova plugin add cordova-plugin-camera
cordova plugin add cordova-plugin-barcodescanner@0.7.0
I made this on macOS High Sierra, and I don't know if this command work on Windows or another OS, but it must.

Sunday, November 19, 2017

How to make permanents changes in phpMyAdmin configuration

I was very pissed off about my phpMyAdmin configuration.

Sometimes, some configuration can be useful, but, sometimes, the same option can be a hindrance. Group databases used to be very useful for me, but, suddenly, that option started to pissed me.


Theres another option with the same experience: By default, show only 50 elements by page:
Many times I need to go inside a table, and then, go to into another table in a faster way, but jumping between one, and another....that's very disagreeable!

And yes, there is a configuration panel with many options, even that what I need to solve the dilema...but there are temporaries, so, I need to solved that issue once and for all.

I realized that there's a "help item" next to the configuration name:


When I clicked that button, a page showed up: The page with the configuration variable that I need to change:
Then, I put that variable with a higher value inside the config.inc.php file:

And that's all. We need to save the file and recharge the page:




Tuesday, September 26, 2017

Fixing Failed to install 'cordova-plugin-fcm': Error: spawn EACCES

Recently I wanted to install the cordova-plugin-fcm plugin on Mac OSX Sierra, but I got this error:

Failed to install 'cordova-plugin-fcm': Error: spawn EACCES
    at exports._errnoException (util.js:1024:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at Object.exports.spawn (child_process.js:493:9)
    at exports.spawn (.../platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
    at .../platforms/android/cordova/lib/builders/GradleBuilder.js:261:16
    at _fulfilled (.../platforms/android/cordova/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (.../platforms/android/cordova/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (.../platforms/android/cordova/node_modules/q/q.js:816:13)
    at .../platforms/android/cordova/node_modules/q/q.js:877:14
    at runSingle (.../platforms/android/cordova/node_modules/q/q.js:137:13)

Error: spawn EACCES

To solved that, I executed the command below this lines from the cordova root project directory:


sudo chmod -R 777 .

Thats all, so I was able to run the plugin installation again:


cordova plugin add cordova-plugin-fcm

...and run like a charm :)