I have a run.sh like this
virtualenv -p python3 env
source env/bin/activate
pip3 install -r requirements.txt
python3 -m profilo.workflow_demo trace.log blocks
When i run this on terminal it runs ok but when i run this shell in external tools android studio it raise an error.
/home/cpu10475-local/Desktop/python/run.sh: 2: /home/cpu10475-local/Desktop/python/run.sh: source: not found
/home/cpu10475-local/Desktop/python/run.sh: 3: /home/cpu10475-local/Desktop/python/run.sh: pip3: not found
Process finished with exit code 1
My tool config is here:
I think the External Tools in Android Studio doesn't support source. So you should try removing the first 2 lines and installing pip3 then run the module again.
Related
I'm using react-native 0.43.3 on OSX.
I tried to running app on Android and get message
react-native run-android
Scanning 568 folders for symlinks in /Users/ruci.k/project/mayacrew/supermembers/supermembers/node_modules (5ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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/android-setup.html
./gradlew installDebug gave me some errors and fixed it all.
Finally build get successed and app is working on Android device.
But react-native run-android command still not work.
Only ./gradlew installDebug command work.
Is there anything can I check to use react-native run-android command?
I can't understand how could it happened.
Running
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
worked for me
Run the following command
chmod 755 android/gradlew
inside your app root folder
then run
react-native run-android
After you create your react native app ,try
sudo chmod -R 777 node-modules
sudo chmod -R 777 android
export ANDROID_HOME=~/Library/Android/sdk
now run
react-native run-android
Try removing android,ios folders and then do react-native upgrade then try again react-native run-android After that if you get an error like
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
then create a file named local.properties inside the folder
android
and insert the following line sdk.dir =/path/to/Android/Sdk After this everything should be fine
Note: If you have made some changes in android/ios folder please keep its backup before removing the folders
cd android && sudo ./gradlew clean
This worked for me. Try it out and let me know if it helps folks
I have faced the same issue when I have imported the project from the GitHub.
Follow the below steps to run your react-native project in the Android device from the MAC OS
Remove the 'node_modules' folder from the root project.
Run the below command in the project root folder.
npm install
Move to the android folder in the project root folder.
cd android
Run the following commands one after another to give permissions to gradlew file.
chmod +x ./gradlew
xattr -l ./gradlew
xattr -d com.apple.quarantine ./gradlew
Now, come back to project root folder and run the project in android device.
react-native run-android
Now you can see the launched application on your connected Android device/emulator.
In Ubuntu, I have used this command and it worked for me:
sudo react-native run-android
I had the same issue, and just opened the project in android studio, and that's all. Solved!
this issue come from two reasons
1- Permission issue
How to Fix it
sudo react-native run-android
Or
chmod 755 android/gradlew
2- Mismatch java version with Gradle
make sure you are using Java 8 as $JAVA_HOME environment variable
depending on which terminal you are using to run your code at
For zsh shell, export $JAVA_HOME at ~/.zshenv or ~/.zshrc.
For bash shell, export $JAVA_HOME at ~/.bash_profile or ~/.bashrc.
get installed JDK by this command
/usr/libexec/java_home -V
example for using zsh
vi ~/.zshrc
// paste the java export inside it
export JAVA_HOME="JDK_8_Path_from_previous command"
to save your change
:x
make sure your changes applied
source ~/.zshrc
now for testing
echo $JAVA_HOME
You must change your build.gradle:
compileSdkVersion 28
buildToolsVersion "28.0.2"
minSdkVersion 16
targetSdkVersion 27
and add this line:
implementation "com.android.support:appcompat-v7:28.0.0"
Check whether your emulator is connected or not:
set ANDROID_HOME path: E:\android-sdk-windows
set path D:C:\Program Files\nodejs;C:\Program Files\Java\jdk1.8.0_111\bin;E:\android-sdk-windows\platform-tools
go to folder android in terminal
gradlew clean
run react-native run-android
maybe install watchman?
https://github.com/facebook/react-native/issues/10056
Otherwise, for me I actually use 'npm start' inside of the folder. npm will know to run the right command to start react native because it's in a react native directory.
So what i did was to download this jar file from: 1: https://drive.google.com/file/d/1MHSJx-_0RHRzlrXBLAePKeWKQteke0Um/view?usp=sharing and placed it inside android/gradle/wrapper then i went back to the project directory and did npm install i then changed directory to android by doing: cd android then i ran the following commands
chmod +x ./gradlew
xattr -l ./gradlew
Now i went back to the project directory and ran react-native run-android
Go to C:\Users\ [username]
Rename or delete ".gradle"
Then run "react-native run-android"
So here are the three solution for this bug , from which one will most probably solve your issue :
1: Adding local.properties file in your android folder
https://stackoverflow.com/questions/32634352/react-native-android-build-failed-sdk-location-not-found
2: Try deleting .gradle file and then build (react-native run-android)
3: Might be possible that under SDK tools NDK(side by side) and CMake are not installed .
Steps for the same is
Android Studio which include direction for opening sdk manager
Open android folder in Android Studio
Click on the SDK Manager (which is at the third position from the top left )
After opening SDK manager you have to go to SDK Tools Installation image for NDK and CMake
Under SDK Tools select NDK(side by side) and CMake and press the okay button and let the installation complete .
After the close the Android Studio and react-native run-android.
1 . you should have space in your phone
2 . developer option on
3 . USB debugging option also on
4 . check "adb devices" devices is connected or not
I have to perform these steps to get it running.
First install dos2unix
Run dos2unix ./gradlew inside android folder
then run ./gradlew clean
at last run react-native run-android.
For me, this had to do with running low on RAM om my Mac.
in gradle.properties put -XX:MaxPermSize=4096
for example like this:
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m
After that, it runs again.
What worked for me is,
Uninstalling the previous installed app version on the emulator device, and running react-native run-android after.
Check the error messages carefully. It will give a clue to what went wrong. In my case, after installing expo in my react-native project, the MainApplication.java got corrupted. I made a comparison with the a backup (you can check an earlier working commit), then removed the erroring lines.
After this, it worked.
I am new to kivy, and try to build an app for android using kivy.
When i was creating an apk for the app
buildozer android debug
with log_level=2
it shows:
Tool unzip is missing
Command failed: ./distribute.sh -m "kivy" -d "kivytut"
Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before
raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2
I'm unable to find any tool called upzip for buidozer(python-for-android) on the internet.
Help.
install unzip using:
sudo apt-get install unzip
moreover following are the tools that must be installed:
git
ant
python2
cython (can be installed via pip)
a Java JDK (e.g. openjdk-7)
zlib (including 32 bit)
libncurses (including 32 bit)
unzip
virtualenv (can be installed via pip)
ccache (optional)
These are several dependencies for python-for-android
I am using Ubuntu 14.04 version and im trying to work with ionic.
The error comes when I try to:
$ ionic start todo blank
$ cd todo
$ sudo ionic platform add android
$ sudo ionic build android
And I get the following error:
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
I know there is alot of sites with a answer to this question, but none of them gave me a fix. Or maybe they did, but I didnt understand it. I tried on this site building-ionic-app, but that didnt work either.
I followed this tutorial by Nic Raboy, and its still not working.
Install Android, Cordova, and Ionic Framework in Ubuntu.
So let me explain what I did and maybe that is helpfull to fix my problem:
I started with this guide: Ionic Framework Guide
To install Cordova, make sure you have Node.js installed, then run
Install Node.js
$ sudo apt-get install -y nodejs
$ node -v
v5.0.0
Install Cordova
$ sudo npm install -g cordova
Follow the Cordova platform guides for Android and iOS to make sure you have everything needed for development on those platforms.
Follow the Cordova platform guides for Android
I followed this guilde:
Complete installing guide for android SDK / ADT Bund on Ubuntu
My computer is 64-bit and since im using 14.04.
Step 2: install libgl1-mesa-dev:i386 package.
$ sudo apt-get install libgl1-mesa-dev:i386
Step 3: Install openjdk-6-jdk or better, openjdk-7-jdk
$ sudo apt-get install openjdk-7-jdk
Step 4: Download the Android SDK or the ADT Bundle from here and unzip it to wherever you want.
Then I follow step 4 on techtach Complete Guide
$ wget http://dl.google.com/android/android-sdk_r20-linux.tgz
$ wget http://dl.google.com/android/adt/22.6.2/adt-bundle-linux-x86_64-20140321.zip
Then I unzipped the adt-bundle and copied the folders from SDK -> /home/kelvin/android-sdk-linux/
The folders are: build-tools,extras,platforms,platform-tools,system-images,tools.
Then I executed the following command to install latest android updates
$cd ~/android-sdk-linux/tools
$sudo ./android
And installed
Android SDK Tools (24.0.2)
Android SDK Platform-tools (20)
ANDROID SDK Build-tools (19.0.3)
SDK Platform
ARM EABI V7a System Image
Android Support Library
And then open bashrc
$gedit ~/.bashrc
And added the following lines.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
export ANDROID_HOME=~/android-sdk-linux/tools
Checking if it is right:
$ANDROID_HOME
bash: /home/kelvin/android-sdk-linux/tools: Is a directory
Create the project & Configure Platforms
$ ionic start todo blank
$ cd todo
$ sudo ionic platform add android
$ sudo ionic build android
And I get the following error:
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
And now im kinda lost. I found a forum where they have the same problem: ANDROID_HOME is not set... and one of the guys suggested.
I finally solved it. It was on my users path but not the root users path. I have to run these commands as a root user. I had to edit my root users .bash_profile file.
and one of the others tells how:
In Ubuntu, do all the commands also root
sudo su
gedit ~/.bash_profile
export ANDROID_HOME=/root/Android/Sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
But a third guy said this is a bad idea, so I didnt do it.
I can run the following command:
$ionic serve
And it runs in the browser, but I cant run for android.
I just read your question and it seems you followed the correct way.I faced the same situation during installation process.
The proper set up an Ubuntu machine for Ionic Framework Android development has many steps.Now there are a ton of options to handle this task, but not many bare bones solutions. Most solutions on the internet explain how to use an IDE, or fail to elaborate a complete installation.
After a research,I have found a nice tutorial by Nic Raboy.I followed this tutorial and everything is fine now.
Install Android, Cordova, and Ionic Framework in Ubuntu
I think we can build it. But I am getting error to build it on Android Studio. First I download the Android Studio and NDK. Then add the PATH of Android Studio and NDK to the PATH Variable. When I run
./check_tools.sh
I get the output
Could not find automake. Please install it.
Could not find autoconf. Please install it.
Could not find pkg-config. Please install it.
Could not find ant. Please install it.
Could not find yasm. Please install it.
Could not find wget. Please install it.
Could not find libtoolize. Please install libtool.
Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly.
Failed to detect required tools, aborting.
But i doubt whether i need these tool on Android Studio or not. When I run the project i get the error
java.lang.UnsatisfiedLinkError: Couldn't load linphone-armeabi-v7a: findLibrary returned null.
Can anybody tell me the solution for that.
Yes you can do this
follow the step by step guide at this blog
How to build culinphone on Android Studio using Mac OS X?
http://culinphone.wordpress.com
Here is a step to step guide.
Setup Linphone Sdk on Mac OS X
How to build Linphone in Android Studio on Mac?
Step by step guide :-
Required Knowledge :-
Android Tools
Android Studio
A little bit about mac-terminal(shell)
S/W Requirements:-
Mac OS-X with these tools (You definetely need these tools to build linphone) :-
coreutils, automake, autoconf, libtool, intltool, wget, pkgconfig ,cmake,
gmake, yasm, grep, doxygen, ImageMagick, optipng, antlr3
STEP 1:-
Concerning these useful tools you can install the tools with this command
$sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng antlr3
STEP 2:-
Check out these Instructions how to upgrade nasm
STEP 3:-
Then install ant by typing
brew update #update if already installed
brew install ant
If you haven’t installed brew just type command give below
its a medium size download which takes 5 mins to download
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Just follow the process which involves installing various components. If you already have brew installed, make sure it’s up to date by executing:
brew update
Once installed you can simply type:
brew install ant
STEP 4:-
Now its time to install libtool. To install libtool run the command given below
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install
STEP 5:-
if you have not installed these programmes download and install
Download Android Studio & SDK
Download Android NDK
STEP 6:-
Download git repository of LInphone Android by running command
$ sudo git clone git://git.linphone.org/linphone-android.git –recursive
Now everything is configured perfectly
STEP 7:-
Open terminal and cd into linphone-android
Now when you get into the directory on terminal then check your PATH of SDK & NDK installed on your Mac run
$ echo $PATH
if you see the path with SDK and NDK location then it’s ok to proceed skip the below part and if not then you need to setup the PATH before you execute the make and make install script in
To setup path use:-
$export PATH=/Users/<yourusername>/android-sdks/platform-tools/:/Users//android-sdks/tools/:/Users//Documents/ndk/:/nobackup/local/prog/nasm/bin/:$PATH
it’s like export PATH=(Path of your SDK platform tools folder):(Path of your SDK tools folder):(Path of your NDK folder):$PATH
This will set up the path and to confirm again run
$ echo $PATH
Now if the Path is already setup you can simply run
$ make
Now connect your Device to you Mac and see if eclipse has detected it. After the device is connected run:
$ make install
Now if everythink is OK:-
After you have made your build then now you can import it into your Android Studio.
Open Android Studio
Import Project (Eclipse,ADT,Gradle,etc.) > select linphone-android > OK
I am able to build the limphone on mac by follow the steps describe here :-
Linphone for android is not working/missing libraries
You definetely need these tools to build linphone.
Concerning nasm I had the same problem. You can use this site that instructs you how to upgrade to a newer nasm:
Instructions how to upgrade nasm
Concerning other useful tools you can install the tools below with this command:
$sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng antlr3
All these are found in the linphone build instructions README.md file.
Today I tried PhoneGap/Cordova with Mac OS X Mavericks. Building for iOS went just fine, but building for Android wasn't without some guesswork.
I installed Android 4.2.2 via the Android SDK Manager (I had to use the older API v17 since it wasn't compatible with a newer one), added the PATH environment variables for the SDK's platform-tools and tools and thought I was ready to take off by running the command:
phonegap run android
Nevertheless, I got the following error:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path.
The error message proved to be true as Apache Ant isn't in the path of Mac OS X Mavericks anymore.
Bulletproof solution:
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Run the PhoneGap build again and it should successfully compile and install your Android app.
You can install ANT through macports or homebrew.
But if you want to do without 3rd party package managers, the problem can simply be fixed by downloading the binary release from the apache ANT web site and adding the binary to your system PATH.
For example, on Mountain Lion, in ~/.bash_profile and ~/.bashrc my path was setup like this:
export ANT_HOME="/usr/share/ant"
export PATH=$PATH:$ANT_HOME/bin
So after uncompressing apache-ant-1.9.2-bin.tar.bz2 I moved the resulting directory to /usr/share/ and renamed it ant.
Simple as that, the issue is fixed.
Note Don't forget to sudo chown -R root:wheel /usr/share/ant
As an alternative to homebrew, you could download and install macports. Once you have macports, you can use:
sudo port install apache-ant
it don't needed port and brew!
because you have android sdk package.
.1 edit your .bash_profile
export ANT_HOME="[your android_sdk_path/eclipse/plugins/org.apache.ant_1.8.3.v201301120609]"
// its only my org.apache.ant version, check your org.apache.ant version
export PATH=$PATH:$ANT_HOME/bin
.2 make ant command that can executed
chmod 770 [your ANT_HOME/bin/ant]
.3 test if you see below message. that's success!
command line execute: ant
Buildfile: build.xml does not exist!
Build failed
I encountered the same issue when trying to use Cordova. Turns out I already had brew, try which brew, but it was outdated. So, I had to update it first:
Update brew: brew update
Install Apache Ant: brew install ant
In my case, I have macport installed already. I simply updated my macport:
sudo port selfupdate
sudo port upgrade outdated
Then install apache-ant:
sudo port install apache-ant
Finally, I add ant to my alias list in my .bash_profile:
alias ant='/opt/local/bin/ant'
Then you are all set.
For OSX your path needs to include /Users/yourusername
their example: /Development/adt-bundle/sdk/platform-tools
needs to be: /Users/yourusername/Development/adt-bundle/sdk/platform-tools