how to setup android development environment in ubuntu for react native - react-native

i am using nodejs --version
v0.10.25 and npm --version 5.6.0 i also installed all the required things
like node, npm ,also installed cli of react native ,android sdk, also add Android sdk into PATH, using virtual device and set device ID to udev rules.
And my file structure is :
drwxrwxr-x 5 aspl aspl 4096 Feb 16 15:17 android
-rw-rw-r-- 1 aspl aspl 1184 Feb 16 15:17 App.js
-rw-rw-r-- 1 aspl aspl 43 Feb 16 15:17 app.json
-rw-rw-r-- 1 aspl aspl 119 Feb 16 15:17 index.android.js
drwxrwxr-x 622 aspl aspl 20480 Feb 16 15:17 node_modules
-rw-rw-r-- 1 aspl aspl 448 Feb 16 15:17 package.json
-rw-rw-r-- 1 aspl aspl 266340 Feb 16 15:17 package-lock.json
drwxrwxr-x 2 aspl aspl 4096 Feb 16 15:17 tests
still i got the error:
Exception in thread "main" javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

The issue is due to not setting up JAVA_HOME. Set it with steps from this link .
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk"
export PATH=$JAVA_HOME/bin:$PATH
save above code to your save that to your .bashrc file and run again

Related

meson doesn't find binary dependency

I compiled wayland from source code with this command
meson --buildtype=release -D prefix=$HOME/mylib -D documentation=false
then installed it with ninja. Now in $HOME/mylib I have this structure:
total 24K
drwxr-xr-x 6 myuser myuser 4.0K Dec 3 19:52 .
drwxr-xr-x 16 myuser myuser 4.0K Dec 4 17:41 ..
drwxr-xr-x 2 root root 4.0K Dec 3 19:52 bin
drwxr-xr-x 2 root root 4.0K Dec 3 19:52 include
drwxr-xr-x 3 root root 4.0K Dec 3 19:52 lib
drwxr-xr-x 4 root root 4.0K Dec 3 19:52 share
Inside bin folder I have wayland-scanner and when I run this command
wayland-scanner -v
I got this output:
wayland-scanner 1.21.90
Now when I build other source code with meson that has wayland-scanner as dependency I got this error:
../tests/meson.build:2:0: ERROR: Invalid version of dependency, need 'wayland-scanner' ['>=1.20.0'] found '1.18.0'.
This is related to another wayland-scanner that is placed here:
/usr/bin/wayland-scanner
with version 1.18.0. The command
echo $PATH
reply with this output:
/home/myuser/mylib/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Why meson doesn't find the updated version of wayland-scanner? Using PKG_CONFIG_PATH doesn't work, same error as above
Hi don't know the wayland package, but from description
I could think that /usr/bin/wayland-scanner is a link to the old installation,
Try to look in your environment for the wayland-scanner scanner binary to check if there is some link do not updated to the new installation.

apache2.service: Control process exited, code=exited status=139

I install apache2 on ubuntu 18.04. This is fresh install with all default configuration.
I tried to start apache2 but failed. And this is what I see.
# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Wed 2020-03-11 23:17:35 WIB; 13s ago
Process: 9151 ExecStart=/usr/sbin/apachectl start (code=exited, status=139)
Mar 11 23:17:35 xdn.id systemd[1]: Starting The Apache HTTP Server...
Mar 11 23:17:35 xdn.id apachectl[9151]: Segmentation fault
Mar 11 23:17:35 xdn.id apachectl[9151]: Action 'start' failed.
Mar 11 23:17:35 xdn.id apachectl[9151]: The Apache error log may have more information.
Mar 11 23:17:35 xdn.id systemd[1]: apache2.service: Control process exited, code=exited status=139
Mar 11 23:17:35 xdn.id systemd[1]: apache2.service: Failed with result 'exit-code'.
Mar 11 23:17:35 xdn.id systemd[1]: Failed to start The Apache HTTP Server.
When I check /var/log/apache2/error.log, there is empty.
What's wrong with this error?
The "status=139" error must have something to do with having multiple, conflicting versions of PHP enabled.
I am running 18.04 and an old PHP site I run only locally ceased to work. I am guessing aptitude installed and enabled php7.2, possibly when I installed kubuntu-desktop a few weeks back.
Regardless, I had two versions of PHP enabled:
$ cd /etc/apache2/
$ l mods-*/php*
-rw-r--r-- 1 root root 867 Jun 9 2017 mods-available/php5.6.conf
-rw-r--r-- 1 root root 102 Jun 9 2017 mods-available/php5.6.load
-rw-r--r-- 1 root root 867 Mar 2 2017 mods-available/php7.0.conf
-rw-r--r-- 1 root root 102 Oct 1 2018 mods-available/php7.0.load
-rw-r--r-- 1 root root 855 Jul 7 2017 mods-available/php7.1.conf
-rw-r--r-- 1 root root 102 Jul 7 2017 mods-available/php7.1.load
-rw-r--r-- 1 root root 855 Feb 8 2019 mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 Feb 8 2019 mods-available/php7.2.load
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.conf -> ../mods-available/php5.6.conf
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.load -> ../mods-available/php5.6.load
lrwxrwxrwx 1 root root 29 May 28 06:05 mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 May 28 06:05 mods-enabled/php7.2.load -> ../mods-available/php7.2.load
In my case, I am fine with using php5.6, because the site is not online and is purely for my local use only. So disabling 7.2 did the trick:
sudo a2dismod php7.2
Now my php mods-enabled are less confusing to apache3:
$ l mods-*/php*
-rw-r--r-- 1 root root 867 Jun 9 2017 mods-available/php5.6.conf
-rw-r--r-- 1 root root 102 Jun 9 2017 mods-available/php5.6.load
-rw-r--r-- 1 root root 867 Mar 2 2017 mods-available/php7.0.conf
-rw-r--r-- 1 root root 102 Oct 1 2018 mods-available/php7.0.load
-rw-r--r-- 1 root root 855 Jul 7 2017 mods-available/php7.1.conf
-rw-r--r-- 1 root root 102 Jul 7 2017 mods-available/php7.1.load
-rw-r--r-- 1 root root 855 Feb 8 2019 mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 Feb 8 2019 mods-available/php7.2.load
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.conf -> ../mods-available/php5.6.conf
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.load -> ../mods-available/php5.6.load
Naturally for a live site one would want to disable php-5.6 and leave the php7.2 enabled, because you should run the newer version in real life.
sudo a2dismod php5.6
sudo a2enmod php7.2
Then the php mods should look like this:
$ l mods-*/php*
-rw-r--r-- 1 root root 867 Jun 9 2017 mods-available/php5.6.conf
-rw-r--r-- 1 root root 102 Jun 9 2017 mods-available/php5.6.load
-rw-r--r-- 1 root root 867 Mar 2 2017 mods-available/php7.0.conf
-rw-r--r-- 1 root root 102 Oct 1 2018 mods-available/php7.0.load
-rw-r--r-- 1 root root 855 Jul 7 2017 mods-available/php7.1.conf
-rw-r--r-- 1 root root 102 Jul 7 2017 mods-available/php7.1.load
-rw-r--r-- 1 root root 855 Feb 8 2019 mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 Feb 8 2019 mods-available/php7.2.load
lrwxrwxrwx 1 root root 29 May 29 17:43 mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 May 29 17:43 mods-enabled/php7.2.load -> ../mods-available/php7.2.load
Don't forget to resatart the server!
systemctl restart apache2
Thanks to Pavel's comment for inspiring this line of research!
I got this error and I fixed it by enabling PHP version 8.0 (current stable) and disabling PHP version 7.4 (old) in my ubuntu 20.04 by these commands:
sudo a2dismod php7.4
sudo a2enmod php8.0
sudo service apache2 restart
After doing these check your apache status by:
sudo systemctl status apache2.service
It has to be green and must show you active (running).
NOTE: You can do this to any PHP version that you have and want to
change.

Perl6 script on MSYS2 causes 'failed to stat file' error

When I try to run a simple perl6 script on MSYS2-64 (bash.exe) on Windows 7 it says:
Could not open my-perl6-script.pl. Failed to stat file: no such file or directory
The same script runs perfectly fine on CMD.exe so I guess it's some incompatibility between perl6 and MSYS2.
$ perl6 -v returns:
This is Rakudo Star version 2018.04.1 built on MoarVM version 2018.04.1 implementing Perl 6.c.
The bin folder of perl6 is:
-rwxr-xr-x 1 win7 None 537938 May 11 2015 libgcc_s_sjlj-1.dll
-rw-r--r-- 1 win7 None 130262 May 7 2018 libmoar.dll.a
-rwxr-xr-x 1 win7 None 57681 May 11 2015 libwinpthread-1.dll
-rwxr-xr-x 1 win7 None 6633702 May 7 2018 moar.dll
-rwxr-xr-x 1 win7 None 57225 May 7 2018 moar.exe
-rw-r--r-- 1 win7 None 104 May 7 2018 nqp.bat
-rw-r--r-- 1 win7 None 104 May 7 2018 nqp-m.bat
lrwxrwxrwx 1 win7 None 23 Jun 19 2018 perl6 -> /c/rakudo/bin/perl6.exe
-rw-r--r-- 1 win7 None 242 May 7 2018 perl6.bat
lrwxrwxrwx 1 win7 None 23 Jun 19 2018 perl6.exe -> /c/rakudo/bin/perl6.bat
-rw-r--r-- 1 win7 None 248 May 7 2018 perl6-debug-m.bat
-rw-r--r-- 1 win7 None 242 May 7 2018 perl6-m.bat
It doesn't matter if I run the script using perl6, perl6.exe or perl6.bat; they all give the same error. I'd like to run perl6 scripts on MSYS2-64. What should I do? Thanks
I installed Rakudo for Windows and made a custom perl6 shell script:
#!/bin/sh
/c/rakudo/bin/moar --execname="$0" --libpath='C:\rakudo\share\nqp\lib' --libpath='C:\rakudo\share\nqp\lib' --libpath='C:\rakudo\share/perl6/lib' --libpath='C:\rakudo\share/perl6/runtime' 'C:\rakudo\share\perl6\runtime\perl6.moarvm' "$#"
I copied perl6.bat to perl6, changed the initial path to moar to an MSYS-style path, and changed from cmd to sh quoting and arugment conventions.
Example run, from cmd:
C:\Users\cxw>perl6 -v
This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.
From the shell opened by msys2_shell.cmd:
$ uname -a
MSYS_NT-6.1-7601 Desktop 3.0.7-338.x86_64 2019-07-03 08:42 UTC x86_64 Msys
$ export PATH="$PATH":~/bin
$ cat foo.p6
use v6;
(2+2).say;
$ perl6 foo.p6
4
For what it's worth, my Rakudo bin dir:
$ ls -l /c/rakudo/bin
total 8033
-rwxr-xr-x 1 cxw None 930663 May 11 2017 libgcc_s_seh-1.dll
-rw-r--r-- 1 cxw None 136146 Mar 30 21:55 libmoar.dll.a
-rwxr-xr-x 1 cxw None 56978 May 11 2017 libwinpthread-1.dll
-rwxr-xr-x 1 cxw None 7021172 Mar 30 21:55 moar.dll
-rwxr-xr-x 1 cxw None 64066 Mar 30 21:55 moar.exe
-rw-r--r-- 1 cxw None 126 Mar 30 21:56 nqp.bat
-rw-r--r-- 1 cxw None 126 Mar 30 21:56 nqp-m.bat
-rw-r--r-- 1 cxw None 242 Mar 30 21:56 perl6.bat
-rw-r--r-- 1 cxw None 248 Mar 30 21:56 perl6-debug-m.bat
-rw-r--r-- 1 cxw None 242 Mar 30 21:56 perl6-m.bat

Apache: Error writing httpd-userdir.conf: Permission denied

I'm following this guide so that I can run websites on a local server using Apache on OS-X El Capitan. I'm trying to edit my httpd-userdir.conf file but when I try to save it gives me the error:
Error writing httpd-userdir.conf: Permission denied
Terminal shows that the permissions for my httpd-userdir.conf file is -rw-r--r-- , so I don't understand why I wouldn't be allowed to write?
drwxr-xr-x 15 root wheel 510B Feb 24 13:35 ./
drwxr-xr-x 11 root wheel 374B Feb 24 13:27 ../
-rw-r--r-- 1 root wheel 2.8K Jul 31 2015 httpd-autoindex.conf
-rw-r--r-- 1 root wheel 1.7K Jul 31 2015 httpd-dav.conf
-rw-r--r-- 1 root wheel 2.9K Jul 31 2015 httpd-default.conf
-rw-r--r-- 1 root wheel 1.1K Jul 31 2015 httpd-info.conf
-rw-r--r-- 1 root wheel 5.0K Jul 31 2015 httpd-languages.conf
-rw-r--r-- 1 root wheel 1.0K Jul 31 2015 httpd-manual.conf
-rw-r--r-- 1 root wheel 4.4K Jul 31 2015 httpd-mpm.conf
-rw-r--r-- 1 root wheel 2.2K Jul 31 2015 httpd-multilang-errordoc.conf
-rw-r--r-- 1 root wheel 13K Jul 31 2015 httpd-ssl.conf
-rw-r--r-- 1 root wheel 607B Jul 31 2015 httpd-userdir.conf
-rw-r--r-- 1 root wheel 607B Feb 24 13:35 httpd-userdir.conf.bak
-rw-r--r-- 1 root wheel 1.5K Jul 31 2015 httpd-vhosts.conf
-rw-r--r-- 1 root wheel 3.1K Jul 31 2015 proxy-html.conf
#erapert was correct, I just had to do sudo vi /etc/apache2/extra/httpd-userdir.conf and that allowed me to edit the file.

Rails 4 - no CSS on production server

We have this strange problem with assets for our Rails 4.2.0 app. The CSS is fine in development and live compilation on production (config.assets.compile = true). But there is no CSS after assets precompile on production server:
RAILS_ENV=production bundle exec rake assets:clean assets:precompile RAILS_RELATIVE_URL_ROOT=/mysuburi
There is no error in precompile and here are the files under public/assets:
-rw-rw-r-- 1 ubuntu ubuntu 385054 Jun 22 00:25 application-2baaa11c334b4d3babfdf9ef2805de93.js
-rw-rw-r-- 1 ubuntu ubuntu 108205 Jun 22 00:25 application-2baaa11c334b4d3babfdf9ef2805de93.js.gz
-rw-rw-r-- 1 ubuntu ubuntu 3622 Jun 13 01:26 application-d5ed8ccf82d536a6438fc4d9ec872407.css
-rw-rw-r-- 1 ubuntu ubuntu 996 Jun 13 01:26 application-d5ed8ccf82d536a6438fc4d9ec872407.css.gz
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 authentify
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 banquet_coursex
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 banquetx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 biz_workflowx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 commonx
-rw-rw-r-- 1 ubuntu ubuntu 23320 Jun 13 01:26 glyphicons-halflings-regular-3348022530037ee257256d4a9f1deac5.woff
-rw-rw-r-- 1 ubuntu ubuntu 20335 Jun 13 01:26 glyphicons-halflings-regular-5cc7f3b91ad7b47947e11514eae4b44e.eot
-rw-rw-r-- 1 ubuntu ubuntu 41280 Jun 13 01:26 glyphicons-halflings-regular-63fc0d7eea1f7cf2b6e8696ffb7bc83e.ttf
-rw-rw-r-- 1 ubuntu ubuntu 62926 Jun 13 01:26 glyphicons-halflings-regular-ff3e6d7867d7162f8531ba867cf354f9.svg
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 jquery-ui
-rw-rw-r-- 1 ubuntu ubuntu 12346 Jun 22 22:33 manifest-04f60cb489f7e161973b51f026287385.json
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 searchx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 state_machine_logx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 user_manualx
application-xxx.css and manifest-xxx.json are there. In Gemfile, the version of sprockets and tilt are set to:
gem 'sprockets', '2.12.3'
gem 'tilt', '~>1.4.1'
Here is the production.rb:
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false #ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.compress = true
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
We tried clean cache with assets:clean a few times with no avail. There are only a few values we can change for the assets. We have rolled back the version of sprockets to fix the problem in assets precompile. We have the default setup about assets location (public/assets) and application-xxx.csss file is there. What else could be wrong with CSS?