I installed flutter SDK using ubuntu "snap" by running:
$ sudo snap install flutter --classic
and when i want to add PATH of flutter sdk to android studio
i have a seroius problem !!
recently i searched flutter sdk paths and i saw some guys said , if you installed it with snap,
this is sdk path:
/home/user_name/snap/flutter/common/flutter
then I checked this path and i saw in common directory i have a zip file and there is no flutter directory , i tried to unzip that file but it gives error and cannot unzip it.
please help me , please ....
This problem happened to me, i solved it by uninstalling the flutter by snap and then following the installation on the website by downloading the .tar file
sudo snap remove flutter
After uninstalling the flutter with the snap follow the manual installation step of the link
https://flutter.dev/docs/get-started/install/linux
Once you install flutter using snapd, make sure you run flutter sdk-path to have your flutter path initialized and the process completes successfully. Otherwise, if the process is terminated without completion, your OS won't recognize flutter.
Download the last version of Flutter manually
Delete all files located in this path:
/home/user_name/snap/flutter/common/flutter
3. Extract all files from the downloaded .tar.xz to the flutter folder
Extract the latest .tar file for flutter
delete all the folders in home/snap/flutter/common/flutter/...
Extract the downloaded .tar inside the current directory
I had the same problem, it was solved by restarting the computer. Simply.
Using Flutter with superuser it worked for me.
e.g
sudo flutter sdk-path
sudo flutter doctor
Related
I'm trying to get Flutter + Android Studio set up as per the guidelines in https://flutter.dev/docs/get-started/install/linux
I installed flutter using ubuntu "snap" by running:
$ sudo snap install flutter --classic
When setting up a Flutter project in android studio now, it's asking me to enter a Flutter SDK path. I can't find a path that satisfies the flutter SDK path requirement. The one that I tried so far is /snap/flutter/current but that didn't seem to work. Any ideas on where the SDK is located before I go ahead and redownload it to some local directory in /home/...?
I installed the same way, and I found the flutter SDK in my home path under snap flutter common flutter
/home/foobaruser/snap/flutter/common/flutter
also, you can check your path with
flutter doctor -v
After installing flutter using:
sudo snap install flutter --classic
In the same shell, you have to execute (check the note):
flutter sdk-path
It will generate all SDK files in:
/home/$USER/snap/flutter/common/flutter
guys,
I found the answer
node-js-is-not-installed
and I have the same problem
actually, I have nodejs
sudo apt-get install nodejs
Reading state information... Done
nodejs is already the newest version (8.10.0~dfsg-2ubuntu0.4)
.
but if I try to build I coach Gradle exception like
Node.js is not installed. Visit https://nodejs.org/en/download/ to install it.
Open File
unfortunately, steps by issues/3745 don't resolve it fo me
enter image description here
any help would be appreciated.
I had a identical problem earlier today. But I'm on a Mac. Same behaviour as you experienced.
I've try to reinstall node, and several rebuilding of my project but none of those worked.
In the end, I started over. Seems that the installation of the amplify cli did not went throught the previous time.
npm install -g #aws-amplify/cli
But I've come to another problem with the manifest.xml right after that. I think both are related...
And adding this to my manifest did the job : 'tools:replace="android:name"' (for reference if this problem follow : https://github.com/aws-amplify/amplify-android/issues/532 )
Run this in your project directory and then resync:
npx amplify-app --platform android
At least, this helped me
Did you install amplify using sudo? That has solved my problem.
Also using Mac OSX
Looks like you may not have proper write permissions on node_modules folder, use chmod 777 your_node_module_folder
i was able to build and test apk on to my device by cordova run android,
now suddenly it got stuck could someone help me to fix this issue, i waited almost for 20 min but no changes.
This image has my ionic info and my build part
I reinstalled platform, updated android studio, npm cache clean. but nothing success full.
I think there is something wrong with the gradle, maybe it is being downloaded, which take forever..
You might wanna mannually download the gradle and specify the downloaded path in yout_app_directory/platforms/android/cordova/builders/GradleBuidler.js => maybe somewhere around line 202 var distributionUrl = 'your_gradle_path'
Follows this
cordova platform rm android
Cordova platform add android
Open emulator or connect Device to the system then
Cordova run android
This will help you .
use command 'ionic cordova run android'
or
Update node version. The version you are using is 6.11.0 but ionic is 3.5.0. so please update node version and check again
or
If you are not using ionic3, then you can downgrade your ionic version using a command 'npm install -g ionic#2.2.0'. then use 'ionic run android'
since I updated my mac to Sierra I noticed a strange behaviour in my cordova app: some plugins aren't working anymore, it just seems they are not copied in the ios platform even if when I add the Platform the plugins' folders are copied as usual. It just seems xcode ignore them.
I tried a few things: removing and adding again plugins, updating cordova, uninstalling and reinstalling cordova, updating platforms, trying creating a brand new app... nothing seems to fix the problem.
Searching around I found this command:
$ cordova platform update ios --save
and it worked without doing anything else.
Unfortunately I have to use this command everytime I make a change in the app and I remove and add the platform again so I guess it's a problem in my environment.
I would like to completely uninstall cordova, node.js and git and reinstall everything again. I found a few instructions like in this question for node.js How do I uninstall nodejs installed from pkg (Mac OS X)? but I don't know how to run correctly all of the commands, some of them fail.
Uninstalling cordova and reinstalling works but doesn't solve the problem.
I did it with
$ sudo npm install -g cordova
$ sudo npm uninstall -g cordova
Can someone link me where to find clear instructions step by step? I'm not that good with command line and I really want to fix this problem without formatting the whole system.
Thank you for any help!
Think I have the solution: I removed cordova,
sudo npm uninstall -g cordova
deleted the .cordova folder in my user home folder (it's a hidden folder!) and installed cordova again with
sudo npm install -g cordova
I noticed that one of my old cordova projects was working: remove platform, add platform and by default I had ios platform version 4.3.0. GOOD!
In another cordova project created after latest update it was still using ios platform 4.2.1.
In the root project folder there is the config.xml file and in this file I found this line in just the second project:
<engine name="ios" spec="~4.2.1" />
Just removed and now cordova is using by default the latest version of the ios platform.
I don't know exactly why in one project there was this line and why not in the other one... neither know if I updated the platform in one project before reinstalling cordova and after reinstalling in onther... can't remember.
I just know that now if I create a new project it's correctly using ios platform 4.3.0 and I tried to describe all my steps...
I hope it will be useful for anyone else because I was ready to format my mac to fix this :(
I don't think you really have a problem with node or npm.
It seems to me more the kind of problem that happen when you change your node version without rebuilding node_modules directory.
If you always install modules with --save modifier, try this:
rm -rf node_modules
npm install
...if not, you can make a backup of your node_modules first. But it will be useful only to inspect it to figure out what modules are missing in your 'package.json' file.
On Linux Mint 17.1 x86_64, Cordova v4.3.0 gives this error:
$ cordova run android
Running command: /home/naman/test/platforms/android/cordova/run
WARNING : No target specified, deploying to emulator
WARNING : no emulator specified, defaulting to Sample
Waiting for emulator...
Booting up emulator (this may take a while)....BOOT COMPLETE
/home/naman/test/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error: ENOENT, no such file or directory '/opt/software/android-sdk/tools/tools/lib/build.template'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
at /home/naman/test/platforms/android/cordova/lib/build.js:129:40
at _fulfilled (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/naman/test/platforms/android/cordova/node_modules/q/q.js:574:44
at flush (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
ERROR running one or more of the platforms: Error: /home/naman/test/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project
PATH variable seems to be alright (the path for SDK is correct):
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/software/android-sdk/tools:/opt/software/android-sdk/platform-tools
I installed it using :
sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
npm install -g cordova
The installation went smoothly and the project was created without any error.
Am I missing some dependency?
You may need to uninstall the existing app on your device.
I installed my app on that device from another computer. When I run cordova run android I get
You may not have the required environment or OS to run this project.
But when I try to install my apk by adb it told my that the app was already installed. So I uninstalled it an it worked.
For others having this problem, assuming you have already checked and fixed any environment variables using #Naman Dixit's answer, you may also have to remove and add your platforms:
cmd: cordova platform rm [platform(s) of interest]
delete everything in the [yourproject]/platforms folder. Then:
cmd: cordova platform add [platform(s) of interest]
that was the final step I needed to get everything to work
Make sure you have proper environment variables defined (add this in .bash_login or .profile and do source .profile):
export ANDROID_SDK="/opt/software/android-sdk"
export ANDROID_NDK="/opt/software/android-ndk"
export ANDROID_HOME="$ANDROID_SDK"
export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK/platform-tools"
export PATH="${PATH}:$ANDROID_HOME/tools:$ANDROID_PLATFORM_TOOLS"
Your android sdk doesn't seem to be properly installed or you didn't install the proper android sdk version that has the dependency that you seem to be missing
/opt/software/android-sdk/tools/tools/lib/build.template
I encountered this issue now too. The problem in my case is that the ant.properties file that I'm using is pointed to wrong and NOT existing file.
key.store=D:/Fedmich/_keys/android.keystore
After correcting it, I was able to compile a release apk.
Hope this helps someone in the future. Just be sure to read the error_logs that is given in the command prompt.
This is just to have one more reason for this error documented here and for them who are still searching for solution.
When I came accross this error, I tried almost all the solutions listed on the stackoverflow.
My issue was my device was not getting detected by adb, adb kill-server/start-server also not helped me, ***
but changing USB port helped.
I got a same error
my solution is underlying.
command adb device
no result.....
install usb drive for mobile (my phone is lg g3)
reeboot and command adb device again : result device showing.
then tried again
3. ionic run adnroid --device
"OK";
Happens when platform is added without internet connection.
Ensure internet is OK and type :
cordova platform remove blackberry10
cordova platform add blackberry10
Try to build and run :
cordova run
Hope this fix your problem, also for other platform
I got this error after installing the Crosswalk plugin. To solve it I installed the latest Android SDK, deleted the android folder under platforms and ran
phonegap build android
alternatively
cordova platform add --save android
cordova build android
and it was all good.
I had the same error building the android platform, and no solution given here could help me.
I decided to run the gradlew command shown by cordova, and saw there was a problem with a png file included in the cordova project.
After removing it, I managed building the platform again.
export ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140321/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
then cordova run android works
Ubuntu
If you are having issues on Ubuntu, you may want to try installing the following packages, per the docs:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
You may also need to install this package:
sudo apt-get install lib32z1