I keep experiencing this issue with installing the native iOS and Android requirements.
This is the command
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
From the error, it looks like only the hardware emulator failed.
Below are few tings to try or simply follow an alternate route with this advanced setup guide, which I did and helped for me,
Below steps are to debug with the same command(install script) you used,
1) Run tns doctor and see if the nativescript setup is looking good. It may, as Android hardware emulator is not mandatory for Nativescript to work. Especially when you are planning to develop with a real device connected to your Mac.
2) If the above option says the deployment is not good, try rerunning the above script and choose "N" for the emulator. This will make sure to run any steps in the script after this installation which failed before.
3) After the above step is done, make sure you close and reopen the terminal and check for our ANDROID_HOME and JAVA_HOME environment variables are set. If its not set, set those with appropriate location, restart the terminal and try tns doctor again to see if it worked.
If these steps / advanced setup option didn't help, post "tns doctor" output along with any other error that you are getting.
Related
I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,
Link-1
Link-2
Link-3
Error,
1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
Some notes on solution I tried,
When trying Link-1 i don't see "Qemu-system" in settings. Also created many different versions of AVDs but does seem to work.
After trying Link-2 pulseaudio -D command errors out.
I have also tried Link-3 which looks like widely suggested solution in multiple blog posts. But still I find the same error on emulator startup. I would like to note that I am not smart enough understand this solution.
Thanks in advance for helping out.
Same problem in Ubuntu 20.04, with Android Studio installed from Ubuntu Software. Tried everything (paprefs, this), nothing worked. Uninstall Android Studio Snap and reinstall from tar package downloaded from Android Studio website, works perfect.
I was having a similar issue on Ubuntu 20.04 but I fixed it by uninstalling the store version of Android Studio and following the installation instructions on the Official Android Studio website here: https://developer.android.com/studio/install
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
lib32z1 libbz2-1.0:i386
To install Android Studio on Linux, proceed as follows:
Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
If you're using a 64-bit version of Linux, make sure you first install the required libraries for 64-bit machines.
To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
Select whether you want to import previous Android Studio settings or not, then click OK.
The Android Studio Setup Wizard guides you through the rest of the setup, which includes downloading Android SDK components that are required for development.
I had the same issue, runing Intellij on Ubuntu 20.04. I solved it by adapting a solution from this link
I run this:
sudo ln -s /run/user/1000/pulse/native /run/user/1000/snap.intellij-idea-community/pulse
If you're using Android studio, just try to find "snap.intellij-idea-community" will be named differently, referring to your android studio installation.
On Ubuntu, is possible open the emulator with terminal and change the sound in System Preferences. Works with the instant version of Android Studio. It works with the snap version of Android Studio.
First is needed to add the emulator command to the PATH.
This can be done by editing .bashrc or .zshrc. Preferably these lines should be placed at the end of the file.
export ANDROID_SDK_PATH=$HOME/Android/Sdk
export ANDROID_NDK_PATH=$HOME/Android/Sdk/ndk
export PATH="$PATH:$HOME/Android/Sdk/platform-tools"
export PATH="$PATH:$HOME/Android/Sdk/emulator"
The PATH variable needs to be reloaded. This can be done manually, as shown below, or simply by opening another terminal:
source ~/.bashrc
# OR
source ~/.zshrc
Another way is to add adb and android-sdk-platform-tools-common packages to have the emulator command available. Package names may vary depending on the Ubuntu version.
After that, the emulator command can be used to list available emulators:
emulator -list-avds
Example of output:
Pixel_4_API_30
Pixel_C_API_30
Then can be opened one of the available emulators:
emulator #Pixel_4_API_30
Finally, the emulator probably will appear at the System Preferences:
If this is a Snap it's got strict requirements as far as i/o; that said, if the requirements are similar to those of running Androidx86 using Vbox on Debian (I realize Qemu is a different environment, however, this may be of use for both Jbaba as well as future reference. Step one: make sure that you belong to the group Qemu (or the equivalent for Ubuntu/Snap?). Step two: make sure you belong to the group pulseaudio. Step three: make sure that Qemu is explicitly permitted to access whatever your audio output device is and that it's the device that pulseaudio is configured to output to. There should be a fairly intuitive way of seeing this using Qemu (it's been awhile, so I am not able to tell you where to find it). As for pulseaudio; its GUI will show you.
I got crazy while trying to solve this issue but finally, it was solved. I figured out that we have to enable multiple simultaneous audio outputs in order to hear both sounds the emulator and the OS.
The solution is by installing paprefs small app as the following.
1- Install it:
$ sudo apt install paprefs
2- Open it:
$ paprefs
3- Go to the last tab Simultaneous Output and click on the only option there in order to enable the Simultaneous Output.
4- Restart it:
$ pulseaudio -k
5- If it fails then you have to restart the daemon
$ pulseaudio -D
6- Almost finished, go to the system settings and navigate to Sounds options and change the output sounds to the newly added one as below.
OS : Ubuntu 20.04.
Android studio (snap).
I tried all the methods, none worked for me.
By installing these libs, the sound works now.
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
as Gigi mentionned before
As you can see that there are two devices being shown in the IDEA. But when I run it. It displays the below error that "Unable to locate a development device; please run 'flutter doctor' for information about installing additional components."
Also here is the Response of the Flutter doctor. There is a very strange behavior, when I run flutter doctor, It shows me 2 devices connected when actually are, but when I run the same command again it shows me no devices connected. Basically it shows me these responses in alternate manner. Here is the screenshot for the same.
Here is one more strange behavior of Flutter. Screenshot for the same provided here below
Is it not stable with Ubuntu or something?
Any help is welcome.
I got the same "Unable to locate a development device; please run 'flutter doctor' for information about installing additional components." error in Android Studio 3.1.4.
It turned out that I had an old version of adb dated from 2014(!) inside /usr/bin/ and a new version in ~/android-sdk-linux/platform-tools/ (your path may vary).
As root I made:
cd /usr/bin
mv adb adb_old
ln -s ~/android-sdk-linux/platform-tools/adb adb (look out for your correct path!)
That solved it for me.
HTH, regards.
edit:
My problem originated from a really old misconfiguration. If your ANDROID_HOME and/or(?) ANDROID_SDK env-variables are pointing to the correct paths, it should be ok. - For my case I just issued a which adb and then headed directly to my solution steps. Resumee: the path and version of adb do matter!
You try to connect only to one device and run flutter run in terminal.
Try a few things
Make sure that developer mode is activated on your device (including usb debugging).
Suitable driver is installed on the system for the device.
Use the latest version of SDK.
Run flutter clean before installation.
Use this command in case of multiple devices connected flutter run -d Mi A1
You can also check that cable is properly connected and supports data transfer
If issue still persist then report an issue on github.
Hope it helps..!
I've built an app using ionic2 + cordova, now I am trying to run this in a real device. I have already set up all the things I had to, such as: %JAVA_HOME%, %ANDROID_HOME%, %ANT_HOME% and all the paths as well. However, as I try to run the command: ionic cordova run android, I recevive this error: "CORDOVA IS NOT A VALID TASK".
When I run: "ionic run android" I get this another error: "No emulator images (avds) found, if you would like to create an
avd follow the instructions provided here:
http://developer.android.com/tools/devices/index.html
Or run 'android create avd --name --target '
in on the command line."
Please, I am new in the mobile world, so I thought about starting a small POC, but I am not even being able to run this in my cellphone. Could someone help me out in this issue? I would appreciate it
ADB only recognizes Android devices, and in order for it to recognize your device you need to enable Debugging Mode on the Developer Settings of the device. Check out this tutorial.
The instructions can be found here, or React Native's official site. And I was expecting to get something like this as shown on the official site:
Whereas the reality is:
I run the command to install the devtool locally into my project:
npm install --save-dev react-devtools
Add one line to "scripts" node in package.json:
"react-devtools": "react-devtools"
So, it looks like:
Then I start up the Genymotion emulator, and have a cmd window running react-native start, another cmd window running npm run react-devtools, which will open up the standalone tool:
And I have a third cmd window running react-native run-android. That will open a debugging tab in Chrome. However, nothing happens in the Developer Tool.
And I cannot find $r in the devtool of Chrome:
I thought it might be because the emulator talks to packager server which is localhost:8081. But if I change that setting to: 192.168.1.2:8097, as stated in Developer Tool:
I cannot even run the app in the emulator, it always stops like shown in the screenshot:
Has anyone managed to run it on Windows? Any help is appreciated, thanks.
I'm trying to build Unity project with Jenkins on Mac OS Server.
But when I try to run the following script
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode ${PROJECT_PATH} -executeMethod BuildScript.DevelopmentBuild
The script shows this,
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Does anyone knows how to fix the problem?
Try write from Terminal:
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist
Then log out and log in again.
Now Jenkins will run as agent and can access WindowServer.
Make sure you have -nographics parameter among your startup parameters
I tried
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist
Then Restarted my Mac
And then sudo launchctl load /Library/LaunchAgents/org.jenkins-ci.plist after restarting
It worked
I had this same issue. The problem is with how Jenkins and Unity work individually.
The only way I could find a cleaner work around was:
Ideally have your Jenkins master only do assignments to slave and do not build anything by itself. So your slaves would build the project.
In case above is not easily doable here is a quick workaround:
On your Jenkins master create a slave.
Add a label to execute your Unity project on the newly created slave.
Configure the job to run on dedicated slave that you created above.
All works now!
You also get this error if the user you are running as is not currently logged in graphically.
It looks like you're missing the --projectPath option prior to specifying your project's path?