I am trying to build an Ionic application with ionic build android with no success. I looked around answers in stackoverflow but I can seem to have the same situation.
I get the following error:
ANDROID_HOME=/Users/myuserID/development/android-sdk-macosx
JAVA_HOME=/Users/myuserID/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Co>nten
ts/home
Running:
>/Users/myuserID/development/ionic/keepdoing/platforms/android/gradlew
cdvBuildDebug -b
/Users/myuserID/development/ionic/keepdoing/platforms/android/build.gradle -
Dorg.gradle.daemon=true
ERROR: JAVA_HOME is set to an invalid directory:
/Users/myuserID/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/hom>e
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I have everything set in the .bash_profile:
export PATH=$PATH:/Users/myuserID/development/android-sdk-macosx/platform-
tools
export PATH=$PATH:/Users/myuserID/development/android-sdk-macosx/tools
export ANDROID_HOME="/Users/myuserID/development/android-sdk-macosx"
export
JAVA_HOME="/Users/myuserID/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk
export PATH=$PATH:/usr/local/share/npm/bin
export PATH=$PATH:/usr/local/npm/bin
export PATH=$PATH:/usr/local/lib/node_modules/cordova/
export
PATH=$PATH:/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/home/bin
export PATH=$PATH:/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk
But can't resolve this. Re-installed the android SDK to no avail.
Any help will be greatly appreciated.
A recent update to Android Studio should help anyone landing on this question in 2017! Android Studio 2.2+ comes bundled with a custom OpenJDK build, so there's no need to download a separate JDK.
The following are the adjusted instructions available at https://ionicframework.com/docs/developer-resources/platform-setup/mac-setup.html using the new locations bundled with Android Studio app.
Create and open the .bash_profile file in your favourite text editor:
touch ~/.bash_profile
open -a TextEdit ~/.bash_profile`
Populate the file with:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
export PATH=${JAVA_HOME}/bin:$PATH
# Set Android_HOME
export ANDROID_HOME=~/Library/Android/sdk/
# Add the Android SDK to the ANDROID_HOME variable
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
#Set GRADLE_HOME
export GRADLE_HOME=/Applications/Android\ Studio.app/Contents/gradle/gradle-3.2
export PATH=$PATH:$GRADLE_HOME/bin
Save and close the file, then apply these changes by re-sourcing .bash_profile:
source ~/.bash_profile
You'll then be able to run the ionic commands using the built in tools within Android Studio.
You have an unnecessary double quotes before the java home path in .pash_profile. Remove it.
JAVA_HOME="/Users/myuserID/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk
Thanks for all who answered.
Eventually I stumbled on an answer here:
http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
in essence In Mac OSX 10.5 or later, Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home, just export $JAVA_HOME in file ~/. bash_profile or ~/.profile.
Pagugim
Related
I'm trying to create a solver in my /opt/OpenFOAM/OpenFOAM-9/applications/solvers/electromagnetics directory using sudo foamNewSource App newSolver. But, I keep getting the following error:
foamNewSource: Creating new interface file newSolver.C
wmakeFilesAndOptions error: environment variable $WM_OPTIONS not set
And then, although I can see a newSolver.C file, I cannot see a Make directory and neither the rest of the files.
I'm running EndeavourOS Linux x86_64 with kernel 5.15.6-arch2-1 and shell bash 5.1.12. I installed the openfoam-org package from the AUR, and in order to set it up, I have the following in my .bashrc config file:
source /opt/OpenFOAM/OpenFOAM-9/etc/bashrc
At first, when I did env | grep WM I couldn't find WM_OPTIONS in my system. So, after googling a little bit, I added this to my .bashrc file:
source /opt/OpenFOAM/OpenFOAM-9/etc/bashrc
export WM_OPTIONS=linux64GccDPOpt
And now, doing env | grep WM I get:
WM_COMPILER=Gcc
WM_PRECISION_OPTION=DP
WM_PROJECT_USER_DIR=/home/username/OpenFOAM/username-9
WM_MPLIB=SYSTEMOPENMPI
WM_OPTIONS=linux64GccDPOpt
WM_ARCH=linux64
WM_LABEL_SIZE=32
WM_PROJECT=OpenFOAM
WM_THIRD_PARTY_DIR=/opt/OpenFOAM/ThirdParty-9
WM_LABEL_OPTION=Int32
WM_CC=gcc
WM_CFLAGS=-m64 -fPIC
WM_LINK_LANGUAGE=c++
WM_OSTYPE=POSIX
WM_PROJECT_VERSION=9
WM_DIR=/opt/OpenFOAM/OpenFOAM-9/wmake
WM_ARCH_OPTION=64
WM_CXXFLAGS=-m64 -fPIC -std=c++0x
WM_PROJECT_INST_DIR=/opt/OpenFOAM
WM_LDFLAGS=-m64
WM_CXX=g++
WM_COMPILE_OPTION=Opt
WM_PROJECT_DIR=/opt/OpenFOAM/OpenFOAM-9
WM_COMPILER_TYPE=system
WM_COMPILER_LIB_ARCH=64
Now I can see the WM_OPTIONS environment variable (just above WM_ARCH=linux64 and below WM_MPLIB=SYSTEMOPENMPI), but I still get the same wmakeFilesAndOptions error.
I don't know what configuration I'm messing up, so I'd appreciate some help!
Thanks!
Using sudo in this case is not a good idea, instead run the scripts on your home directory:
mkdir -p $FOAM_RUN
cd $FOAM_RUN
foamNewSource App newSolver
For WM_OPTIONS environment variable, don't set it manually, instead use:
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION$WM_COMPILE_OPTION
I am learning Use the NDK with other build systems. Trying to get the example for Autoconf to work. It looks like ./configure --host $TARGET is working as expected. But I get an error while executing make:
arm/filter_neon.S -fPIC -DPIC -o arm/.libs/filter_neon.o
arm/filter_neon.S:24:17: error: expected string in directive
.section __LLVM,__asm
^
make[1]: *** [Makefile:1187: arm/filter_neon.lo] Error 1
I am new to Android and Linux. Here is the .sh-file I am using on Ubuntu:
#!/bin/bash -v
# Check out the source.
git clone https://github.com/glennrp/libpng
cd libpng
# Only choose one of these, depending on your build machine...
#export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
# Only choose one of these, depending on your device...
#export TARGET=aarch64-linux-android
export TARGET=armv7a-linux-androideabi
#export TARGET=i686-linux-android
#export TARGET=x86_64-linux-android
# Set this to your minSdkVersion.
export API=21
# Configure and build.
export AR=$TOOLCHAIN/bin/$TARGET-ar
export AS=$TOOLCHAIN/bin/$TARGET-as
export CC=$TOOLCHAIN/bin/$TARGET$API-clang
export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
export LD=$TOOLCHAIN/bin/$TARGET-ld
export RANLIB=$TOOLCHAIN/bin/$TARGET-ranlib
export STRIP=$TOOLCHAIN/bin/$TARGET-strip
./configure --host $TARGET
make
What am I doing wrong, why the tutorial example doesn't work? Thank you in advance.
There are bug in libpng. Do not use cloning from github. Use released version. There are different link on github https://github.com/glennrp/libpng/releases/tag/v1.6.35
Change this script from official doc and do not clone github repo, just download archive and run this script inside of it.
For me all is working.
Hm. This is my fault :)
I added this to support bitcode enabled builds with non-Apple LLVM. It works there but not on Android. Using the release as suggested by #Alexandr Kirilov is a good call, but this should be fixed upstream in libpng as well.
It needs to be guarded by __APPLE__ as well, see https://github.com/glennrp/libpng/pull/383
Unfortunately, when I patched this I only tested it on macOS/iOS platforms and not on other arm platforms :(
I did compile Ignite Application successfully.
but The Binary didn't work.
/tmp/tmp.Nw0IPD6ru3/cmake-build-debug-local-container/planet_engine: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory
how can I make to it work?
Also, I compiled C++ Examples successfully. such as ignite-compute-example.
and, I execute that but I got an error message.
An error occurred: JVM library is not found (did you set JAVA_HOME environment variable?)
and I using a nightly release version 2.8.0.20190213 because I couldn't build to version 2.7 in my environment.
I posted environment values down.
IGNITE_HOME=
TERM=xterm-256color
SHELL=/bin/bash
LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
LC_NUMERIC=ko_KR.UTF-8
SSH_TTY=/dev/pts/0
JRE_HOME=/root/jre1.8.0_201
USER=root
LS_COLORS=rs=0:d...
LD_LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
CLASS_PATH=/root/jdk-11.0.2/lib:
LC_TELEPHONE=ko_KR.UTF-8
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/jdk-11.0.2/bin
LC_IDENTIFICATION=ko_KR.UTF-8
JAVA_HOME=/root/jdk-11.0.2
LANG=en_US.UTF-8
LC_MEASUREMENT=ko_KR.UTF-8
JDK_HOME=/root/jdk-11.0.2/lib
SHLVL=1
HOME=/root
LOGNAME=root
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_TIME=ko_KR.UTF-8
LC_NAME=ko_KR.UTF-8
_=/usr/bin/env
Thank you for reading. :)
I got it.
I am working on a docker container environment.
and therefore I am using remote build and debug with ssh and gdb.
finally, I found out why it couldn't find libjvm.so and why couldn't read environment values such as JAVA_HOME.
because it is working in gdb for now.
I confirmed that it is working when without gdb.
I will find a solution.
and, if I have been found, I will update the answer.
[Solved]
I share how I make solved that.
I was using an Oracle JDK-11 through source install.
but Ignite C++ client need something different with latest released jdk versions.
Ignite need a directory structure like this
JAVA_HOME/ (as JDK install directory)
- jre/
- lib/
- lib/
...
I solved by apt install openjdk-8-jdk.
openjdk-8-jdk have structure for what Ignite need.
i added JAVA_HOME, IGNITE_HOME, at /etc/environment.
It works finally.
but I got another problem. HAHA
I am so sad.
This also GDB problem..
I did
npm install -g foundation-cli bower gulp
got
/|
| | /| .
. /\| \/ |/|
|\/ | Thanks for installing Foundation for Apps
||\__/\____/|| ------------------------------------------
Then, I did
gem install bundler
and got
Successfully installed bundler-1.10.5
but when I tried
foundation-apps new myApp
I got
'foundation-apps' is not recognized as an internal or external command,
operable program or batch file.
working on windows 7, behind proxy
I have it working in Windows 10 but I believe it is the same.
When I check the npm folder: C:\Users\(YourName)\AppData\Roaming\npm
The command name is foundation instead of foundation-apps
So you should type: foundation new
If you're using fedora-22 and potentially other OSes Siu Pang Tommy Choi's answer is also applicable; that is, replace foundation-apps new NAME with the foundation new NAME.
This is the first time I've encountered this problem, so perhaps there has been a change within the last few versions that has deprecated the foundation-apps command (or else you should consider this a work-around). Just make sure that you correctly specify that you want an 'app' and not a 'site' when prompted.
foundation studios install instructions on the url https://foundation.zurb.com/apps/docs/#!/installation
tells this
"You now have access to the foundation-apps command on your system! You'll use this to set up and update new projects"
Siu Pang Tommy Choi gave the best answer because foundation command worked instead of foundation-apps
still confusing because i am following instructions from the above url.
Are you sure there is no foundation-apps command?
For some reason, whatever Qt-based application I start from a terminal issues some traces I would like to disable.
Example:
$> qtcreator
Got bus address: "unix:abstract=/tmp/dbus-vDsC42Ojkq,guid=dc44d5a0e955ae51a4dbbdc100001ce3"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-vDsC42Ojkq,guid=dc44d5a0e955ae51a4dbbdc100001ce3"
Registered DEC: true
Registered event listener change listener: true
...
...
Do anyone know how to get rid of these messages?
Thanks.
Thanks to Laszlo Papp comment, I took a look to qt-at-spi setup...
$> locate qt-at-spi
/usr/share/doc/qt-at-spi
/usr/share/doc/qt-at-spi/README
/usr/share/doc/qt-at-spi/changelog.Debian.gz
/usr/share/doc/qt-at-spi/copyright
/var/lib/dpkg/info/qt-at-spi:amd64.list
/var/lib/dpkg/info/qt-at-spi:amd64.md5sums
Let's see what README file tells:
$> more /usr/share/doc/qt-at-spi/README
Qt AT-SPI2 bridge
=================
This is a Qt plugin that bridges Qt's accessibility API to AT-SPI2.
With recent versions of AT-SPI2 this should make Qt applications accessible
with the help of tools such as Gnome's Orca screen-reader.
Switch gnome to use at-spi2:
gconftool-2 --set /desktop/gnome/interface/at-spi-dbus --type bool true
gconftool-2 --set /desktop/gnome/interface/at-spi-corba --type bool false
To run gnome apps with at-spi2 in a non-gnome session:
export GTK_MODULES=gail:atk-bridge
Qt will only load this plugin when the environment variable
QT_ACCESSIBILITY is set to 1.
And like the README says, QT_ACCESSIBILITY environment variable was set to 1 on my machine.
So the solution is:
EITHER to remove qt-at-spi module:
sudo dpkg --purge qt-at-spi
OR to unset this variable, which, after a quick research was set in /etc/X11/Xsession.d/90qt-a11y script, based on gnome settings:
gsettings set org.gnome.desktop.interface toolkit-accessibility false
Thank you Laszlo!
I usually redirect all output of GUI apps started from a terminal:
$> qtcreator >/dev/null &
You either need to remove the qt-at-spi package or use QT_ACCESSIBILITY=0 qtcreator.
Here you can find the official README under the KDE umbrella for details:
https://projects.kde.org/projects/playground/accessibility/qtatspi/repository/revisions/master/entry/README