I was just wondering if I can use flutter without downloading Android studio because Android Studio is very heavy
You can do so, by following the below steps.
Note: The sum of all the downloaded files is about 1.5GB including VS Code.
Download and install VS Code 88MB.
Install the Flutter extension, which automatically installs the Dart extension.
Download the Flutter SDK 818MB. Extract to C:\Flutter.
Download the Android Command Line Tools 115MB. Extract to C:\Android\cmdline-tools.
Download the Android Platform Tools 5MB. Extract to C:\Android\platform-tools.
Download the Java SDK (version 17 or lower) 171MB. Extract to C:\Java.
In Environment Variables edit the Path system variable and add the following:
%SYSTEMDRIVE%\Android\platform-tools +
%SYSTEMDRIVE%\Android\cmdline-tools\bin +
%SYSTEMDRIVE%\Flutter\bin +
%SYSTEMDRIVE%\Java\bin.
In Environment Variables add the following new system variables.
Name: JAVA_HOME. Value: C:\Java.
Name: ANDROID_HOME. Value: C:\Android\cmdline-tools.
Name: ANDROID_SDK_ROOT. Value: C:\Android\cmdline-tools.
Run the following command as administrator: sdkmanager --licenses, and accept all the licenses.
In phone's settings, enable Developer options and USB debugging, also enable the Developer mode on your PC.
Connect your phone and make sure that all drivers are installed.
Create a new flutter project and run it using the command flutter run. This will download the needed files (automatically) to run the app on your phone and create an APK file. Download size is about 300MB.
You can use Visual Studio Code or Emacs Link
You can still code, but it won't compile, since Flutter SDK needs the Gradle and other tools(that comes with android studio) to be compiled and run in Android, and the flutter doctor in the command line will complain too and won't let you do much.
Yes you can, you want to download VSCode and get the dart & flutter extensions in it, but you need AVD which is provided with Android Studio to run your applications or you can use any other emulator.
Needless to say you also need the Flutter SDK.
You could try https://dartpad.dev/flutter if you're not planning anything big. It's a flutter version of the dart playground and it lets you test some flutter features, but (as far as I know) it's limited to one file only. And you won't be able to use 3rd party libraries too.
Related
So far I have downloaded two different version for the flutter SDK.
One is v2.10.2 and another is v2.5.3.
Currently Flutter is installed in my Linux system with v2.10.2 but the version 2.5.3 is required to run the old flutter project.
So, I required to downgrade the flutter version. So, How can I change the Path for the flutter SDK from terminal ?
I have tried below way :
export PATH="$PATH:/home/jaiminmodi/snap/flutter/common/v2.5.3/flutter_linux_2.5.3-stable/flutter/bin"
But still while checking flutter version its showing 2.10.0
What might be the issue ? Thanks.
I suggest you to use fvm
https://fvm.app/docs/getting_started/installation
It'll take care of everything you just need to set it up.
I can help you with windows. I don't have prior knowledge in Linux but looking at windows procedure you will understand something.
First, download both v2.10.2 and v2.5.3 zip files and extract them in a folder like the following for v2.10.2 its name flutter, and for v2.5.3 its name flutter253.
In my case, I have two versions latest and v1.22.6.
Now create one folder named aliases.
Create two batch windows files named flutter and flutter253.
In my case, it's flutter and flutter1226.
Now edit both files using notepad and add the following line.
for the latest version add code (Add your latest flutter version bin path)
#echo off
D:\"Program files"\flutter\bin\flutter %*
for another version add the following code (Add your v2.5.3 flutter version bin path in my case it was v1.22.6 means flutter1226 folder bin path you will be flutter253)
#echo off
D:\"Program files"\flutter1226\bin\flutter %*
Now add aliases folder path in your user and system path environment variables like the following (I highlighted the image)
1. User
2. System
Congrats! it's done now you can you both versions by running commands like
flutter --version and
flutter253 --version in my case it's flutter1226 --version
Now to add it's in your vscode do as the following image
1. go to settings and search dart SDK
2. by clicking the flutter version below you can change the SDK version.
I have a portable version of vscode on my Windows PC. I have flutter installed as well. flutter doctor does not detect my VS Code. I'm guessing it is because its not installed via an installer. It was just copy pasted into a folder.
How can I tell flutter where my VSCode is and that it is my preferred editor without installing it (since I do not have admin rights on the PC)? I tried flutter config -h and it only lists the following options
--[no-]analytics Enable or disable reporting anonymously tool usage statistics and crash reports.
--clear-ios-signing-cert Clear the saved development certificate choice used to sign apps for iOS device deployment.
--gradle-dir The gradle install directory.
--android-sdk The Android SDK directory.
--android-studio-dir The Android Studio install directory.
We only look in the default install locations for each platform. You can find the code here:
https://github.com/flutter/flutter/blob/217b2bdaa18de2bfddf213bc920b1337e77f1be3/packages/flutter_tools/lib/src/vscode/vscode.dart#L87-L154
You're not missing out on anything by not having it found, all Doctor does is lists it if it's found and tells you if you're missing the Dart Code extension.
Want to set up a linux server only to build and test, and I found Android does not offer sdk only package anymore.
Previous sdk download page was redirect to studio download page.
I need android sdk package. but now Android only supply the sdk-tool, in my mind sdk-tool/ is under sdk/, like path-to-sdk/tools. When android project builds, I need to set env $ANDROID_HOME, and $ANDROID_HOME is the directory of the sdk/ not the sdk/tool/
I try the android-studio-linux, but the pack I unzipped can not found android sdk, it seems android download sdk on first run.
I try the to find the android-sdk, but only get the older releas.
Please give me some suggestion, how to build android apk in non-gui linux server, the server is Ubuntu 64bit.
Well they still offer, they just have moved it to bottom to promote Android Studio more over other other IDEs.
Check the bottom of the page or just use this link to download it for linux. You can very well use gradle to build and package your app so if there is actually no compulsion of using Android Studio.
Update Also this document explains how to develop Android apps/libs from commandline.
I have tried to use ionic lab. I tried to build a simple blank app using the lab but when I go to build my android app it says I need to have android sdk. I have android sdk and the platform tools already. I even added to my path in case you were wondering. I was graciously sent here to ask for help after trying to research my issue by looking at "ionic android build error - failed to find android_home".(which was when i checked my environment path). I took a screen shot of both(environment and error from ionic lab console). error and
environment
For windows:--
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
The Android SDK download does not include specific Android platforms. To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.
Open the Android SDK Manager window:
android
Note: If this command does not open the Android SDK Manager, then your path is not configured correctly.
Select the Tools checkbox.
Select the checkbox for the latest Android SDK.
From the Extras folder, select the checkbox for the Android Support Library.
Click the Install packages... button to complete the download and installation.
Note: You may want to install all the available updates, but be aware it will take longer, as each API level is a large download.
Could you please do following stuff in terminal. It might be helpful for you.
Step:--1
export ANDROID_HOME=~/android-sdk-macosx
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
Step:--2
Update SDK and go to directiory and set your SDK path properly.
Helo,
I am currently trying to build the base phonegapp android app that's automatically created, so I navigated to the directory... but when I use the command
phonegap build android
I just get this random error, as shown in the attatched picture.
Extra info
I am currently on Windows 8, and am completely new to making apps, and am new to the command line as well. Not very familiar with this stuff...
What I'm trying to do would be called 'compiling', right?
Yeah, I had the same problem yesterday - but with a little help of a colleague I got it!
Step by step tutorial (for Windows)
Install node js
Install phonegap using command line: npm install -g phonegap
Install Android SDK
Launch Android SDK Manager and install Android 4.4.2 (API19)
Because latest phonegap/cordova version requires this
Documentation for Android SDK and SDK Platform should be enough
Also update already existing packages
Create an environment variable called ANDROID_HOME which points to destination of Android SDK. e.g. C:\Users\You\AppData\Local\Android\android-sdk
Download Apache Ant and extract the archive somewhere
Create an environment variable called ANT_HOME which points to destination where you have extracted Ant
Install JDK (Java Development Kit) for your System. Before you are able to download, you have to accept the licence
Create an environment variable called JAVA_HOME which points to destination of JDK
If you want to add plugins via phonegap automatically you should also install GIT.
Last but not least you need to add the following directories to PATH environment variable:
%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin
Each folder is separated by a semicolon
Setting environment variables will take effect just for new command line windows. So you should reopen it, after the whole process.
Easy, isn't it? ;-)
Now you can use phonegap build android after you've created a new phonegap project. If you have your smartphone plugged via USB and installed the USB drivers, and activated the USB Debugging on smartphone, you may use
phonegap run android
And the ready build APK will be transfered and executed on your smartphone. Perfect for testing.
If you want to create a final release APK, go to
YOURPROJECT\platforms\android\ant-build
and enter ant release.
You'll find the final APKs in YOURPROJECT\platforms\android\bin.
They are unsigned, here is a Noob guide to signing an APK.
I have tested a Barcode Scanner example, and it works seamlessly.
Have fun!
also check android in cmd, if it says: 'xcopy' was not recognized.
then add to your path:
%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;
Armin's guide is perfect. But if you still fail you can do this.
Phonegap platform files stay in C:\Users[username].cordova\lib folder. Go there and remove android/ios/bb... driectory.
For best result run this command:
npm cache clear
After that try again, clean platfrom files will be download and build your project.