Android Studio and Monkeyrunner - monkeyrunner

I am using AS version 0.5.4 on a Mac. Per bash profile PATH points to
export PATH=$PATH:/Applications/Android\ Studio.app/sdk/platform-tools/
When I cd to that directory, I can't find monkeyrunner. I also tried updating AS but that didn't help. Has anyone used monkeyrunner with AS? Any help shall be appreciated.
Thanks.

AS utilizes standalone Jython to run MonkeyRunner.
Try to export your env PATH to: /Applications/Android\ Studio.app/sdk/tools

Related

karaf: JAVA_HOME is not valid: /usr/lib/jvm/java-11-openjdk-amd64/bin/java [duplicate]

I am working in Ubuntu 16.04. I need to install gradle and the gradle is installed when i checked with sudo apt list --installed command but when i use gradle -version command it shows the following error,
JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-8-oracle/jre/bin/java
In sudo vim /etc/environment file,
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
http_proxy="http://username:password#IP:port no/"
https_proxy="https://IP:port no/"
ftp_proxy="ftp://IP:port no/"
I don't know where i made mistakes. Please help me.
Thanks.
On a 64bit openSuse 64 42.1 box;
readlink -f $(which java)
provided;
/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
But;
export JAVA_HOME=/usr/lib64/jvm/jre-1.8.0-openjdk
is the path that worked and allowed java emulator to run.
So i think we have to manually browse our file system and see what path to choose.
Today I faced this problem. I am using the default java that comes with your linux distro (so in my case, linux mint).
$ whereis java
This command gave me
java: /usr/bin/java /usr/share/java
So, I opened /user/bin. There was a link to Java. I right clicked it and selected follow original link. This lead me to /usr/lib/jvm/java-11-openjdk-amd64/bin/java.
So now that I know where this java is, I opened my .bashrc file, and edited the JAVA_HOME.
So for my case,
## My Custom variables
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
This solved the problem.
Now if you are using some other java (say you downloaded from oracle and extracted the zip file ...), then you have to add that location. So for example, if your java is in /home/user/.sdkman/candidates/java/current, then
export JAVA_HOME=/home/user/.sdkman/candidates/java/current
export PATH=$JAVA_HOME/bin:$PATH
I see a mismatch. In your enviornment file the JAVA_HOME is set to "/usr/lib/jvm/java-8-openjdk-amd64/" and your mentioned that the error that you got relates to the JAVA_HOME as "/usr/lib/jvm/java-8-oracle/jre/bin/java"
If you JAVA is really installed in /usr/lib/jvm/java-8-oracle directory, then you need to ensure that the JAVA_HOME is set to that directory. And also your PATH reflects $JAVA_HOME/bin in it.
I typically install Oracle JDK/JRE separately in a separate directory such as /usr/local/jdk1.8.0 etc.
check the jvm installtion folder from Files
eg : /usr/lib/jvm/java-12-oracle
then in terminal run sudo nano /etc/environment and add the line
JAVA_HOME="/usr/lib/jvm/java-12-oracle"
Then open terminal and run
export JAVA_HOME="/usr/lib/jvm/java-12-oracle"

The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable program

I'm trying to install flutterfire_cli in my root project, so I typed this command:
FirebaseFirestore firestore = FirebaseFirestore.instance;
so after that, this is the output of my console:
PS C:\Users\PC\Desktop\eventually> dart pub global activate flutterfire_cli
Package flutterfire_cli is currently active at version 0.1.1+2.
Resolving dependencies...
The package flutterfire_cli is already activated at newest available version.
To recompile executables, first run `global deactivate flutterfire_cli`.
Installed executable flutterfire.
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated flutterfire_cli 0.1.1+2.
To fix the warning I added C:\Users\PC\AppData\Local\Pub\Cache\bin to my Path in system variables environnement. (but it does not work, I'm still getting the warning)
Next, I'm trying to generate the firebase_options.dart file as the documentation says using this command:
flutterfire configure
But I'm getting an error in the console:
PS C:\Users\PC\Desktop\eventually> flutterfire configure
flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ flutterfire configure
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (flutterfire:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Could anyone tell me what I am missing, why I am getting this error even if the Firebase CLI already installed on my machine?
Go through this doc very carefully: https://firebase.flutter.dev/docs/cli/
Step 1: Install Firebase CLI
Step 2: Install FlutterFire CLI with this command dart pub global activate flutterfire_cli
While doing this you must notice the following warning
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. A web search for "configure windows path" will show you how.
This means you need to add C:\Users\*username*\AppData\Local\Pub\Cache\bin into your System's environment path.
Step 3: Now flutterfire configure should work.
If still not working play with Firebase commands
For Mac -> Execute this command:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Three 3 steps for getting it work on Windows:
Run this command:
dart pub global activate flutterfire_cli
Type env into Windows search and open Edit the system environment variables --> Environment variables --> System variables( the one on the bottom of the window) --> Double click on Path --> New and enter this:
C:\Users\PutHereYourUsername\AppData\Local\Pub\Cache\bin
flutterfire configure command should work now - close and open again command prompt or other terminal. Sometimes there is a problem with other editors and terminals where flutterfire configure still does not work. In that case open Command Prompt and it works there for sure.
As for me, I have done everything correctly and the command works if I run in the Windows command prompt, but it fails to work if I type the command inside the VS code terminal.
So I just killed the terminal and opened it again, then it works.
Or, you can try restarting your machine.
Even after adding C:\Users\PC\AppData\Local\Pub\Cache\bin to the path for me flutterfire would not work from the command line, the reason being that it actually instally a flutterfire.bat file.
So I use flutterfire.bat in the command line as of now and that is working.
For Linux/Ubuntu run this command in the terminal,
export PATH="$PATH":"$HOME/.pub-cache/bin"
Which you will also notice in the terminal when you run the command ↓.
dart pub global activate flutterfire_cli
Make sure you are your project directory
run this export PATH="$PATH":"$HOME/.pub-cache/bin"
For Linux/Ubuntu you should do the following:
Open your .bashrc file using the command "sudo nano ~/.bashrc"
Add export PATH="$PATH":"$HOME/.pub-cache/bin" to the end of the file.
Final you can source the file using "source ~/.bashrc"
It should now be able to recognize the file.
for macOS Monterey edit ~/.zprofile instead .zshrc
This was the hack i used to solve mine. I copied and pasted the C:\Users\PC\AppData\Local\Pub\Cache\bin in my folder search bar to enter the folder, note I could not find any folder called AppData, but when I pasted it on the folder search it did take me to the bin folder.
In the bin folder, you will find a file called flutterfire.bat. Copy and paste the flutterfire.bat file in the root of your project and then run the .\flutterfire configure command. Please do note the dot (.) and forward-slash (\). You need to add it to work.
for mac m1 , add
export PATH="$PATH":"$HOME/.pub-cache/bin" at the top of users/username/.profile , works on (monterey)
For me, even after I installed everything correctly, restarting my IDE(VSCode) did the trick.
Flutter command not found
Here is very easy instructions for adding something to your path on Mac, It solved my issues with Flutter and Flutterfire.
The export PATH="$PATH":"$HOME/.pub-cache/bin" did not work on my Debian machine!
I removed the first line #!/usr/bin/env sh from $HOME/.pub-cache/bin/flutterfire file and the flutterfire command worked properly.
Use command prompt.. not the vsc terminal
if you followed the right answer and still not working, you need to restart your computer

Adding the ibapi library to PYTHONPATH module in Spyder (Python 3.6)

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Spyder.
What I did so far:
I installed the latest version for Windows from here
I provided the following path to the PYTHONPATH manager in Spyder: C:\TWS API\source\pythonclient\ibapi afterwards I restarted Spyder
When I simply type import ibapi I get the same error message: ModuleNotFoundError: No module named 'ibapi'
What I am doing wrong here and how can I fix this simple error?
I don't use python very much but I'm pretty sure you have to install the ibapi. I never used the PYTHONPATH and mine works fine in Spyder and Jupyter. I'm using Anaconda.
I run the Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install
Then everything works. I think many python packages need to be installed like this.
note: That's not my install dir, I just copied yours. There may be a problem with a space in the path. Try renaming to C:\TWSAPI\... if you still have a problem.
Note: after python setup.py install, you might need to restart spyder. If doesn't help, then copy the newly-created ibapi folder to:
C:\Users\iuzeri\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
or
C:\Program Files (x86)\Python37-32\Lib\site-packages
copy your ibapi here
C:/ProgramData/Anaconda3/Lib/site-packages/ibapi

Where is Meteor installed on Windows?

Hi I've just installed Meteor on Windows 7. Using the command prompt I was hoping I'd just type meteor but that's not working (not recognized). Do I need to set PATH?
Thanks
Simon
C:\Users\yourUserName\AppData\Local\.meteor\
You can also set that in your PATH when it is missing there.
On windows its installed here
C:\Users\<username>\AppData\Local\.meteor
but meteor command does not work sometime. To make meteor command working you need to modify path variables as follows.
Automatically set Path (after installation)
C:\Users\<username>\AppData\Local\.meteor\
Modification (remove backslash)
C:\Users\<username>\AppData\Local\.meteor

dart_api.h not found when build library dart_sqlite

As i ask before, to use dart-sqlite, I must install dart-ext:sqlite first. But every time I try to build it, I found error= Can not found dart_api.h. how to fix it?
I install it on ubuntu 12.04.
Thank you
It sounds like you didn't follow the build instructions:
Either edit build.sh to point to the SDK, or set the environment variable DART_SDK.
Once you correctly point DART_SDK to the dart-sdk directory of your local Dart installation, the build system will find $DART_SDK/include/dart_api.h just fine.

Resources