{"id":11996,"date":"2024-08-14T02:17:55","date_gmt":"2024-08-14T02:17:55","guid":{"rendered":"https:\/\/myprojects.advchaweb.com\/?p=11996"},"modified":"2024-08-14T04:20:47","modified_gmt":"2024-08-14T04:20:47","slug":"install-flutter-and-android-studio-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2024\/08\/14\/install-flutter-and-android-studio-on-ubuntu-22-04\/","title":{"rendered":"Install Flutter and Android Studio on Ubuntu 22.04"},"content":{"rendered":"<p>Ref: https:\/\/docs.flutter.dev\/get-started\/install\/linux\/android<\/p>\n<p>Development tools<\/p>\n<p>To develop Flutter on Linux:<\/p>\n<p>1. Verify that you have the following tools installed: bash, file, mkdir, rm, which<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ which bash file mkdir rm which\r\n\/usr\/bin\/bash\r\n\/usr\/bin\/file\r\n\/usr\/bin\/mkdir\r\n\/usr\/bin\/rm\r\n\/usr\/bin\/which<\/pre>\n<p>2. Install the following packages:\u00a0curl,\u00a0git,\u00a0unzip,\u00a0xz-utils,\u00a0zip,\u00a0libglu1-mesa<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y\r\nsatria@teddy:~$ sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa<\/pre>\n<p>3. To develop Android apps:<br \/>\na. Install the following prerequisite packages for Android Studio.<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ sudo apt-get install \\\r\n    libc6:amd64 libstdc++6:amd64 \\\r\n    libbz2-1.0:amd64 libncurses5:amd64<\/pre>\n<p>b. Install\u00a0Android Studio\u00a02023.3.1 (Jellyfish) or later to debug and compile Java or Kotlin code for Android. Flutter requires the full version of Android Studio.<br \/>\ndownload and install the latest android studio from https:\/\/developer.android.com\/studio<\/p>\n<p>If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386<\/pre>\n<p>read the installation note on https:\/\/developer.android.com\/studio\/install#linux<\/p>\n<p>Extract the downloaded file:<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ cd Downloads\/\r\nsatria@teddy:~\/Downloads$ tar -xvzf android-studio-*-linux.tar.gz<\/pre>\n<p>Move to the android-studio directory:<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~\/Downloads$ sudo mv android-studio \/opt\/<\/pre>\n<p>Run Android Studio:<br \/>\nNavigate to the bin directory and run the installer:<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~\/Downloads$ cd \/opt\/android-studio\/bin\/\r\nsatria@teddy:\/opt\/android-studio\/bin$ .\/studio.sh<\/pre>\n<p>Use VS Code to install Flutter<\/p>\n<p>To install Flutter using these instructions, verify that you have installed\u00a0Visual Studio Code\u00a01.77 or later and the\u00a0Flutter extension for VS Code.<\/p>\n<p>Prompt VS Code to install Flutter<br \/>\n#<br \/>\nLaunch VS Code.<br \/>\nTo open the\u00a0Command Palette, press\u00a0Control\u00a0+\u00a0Shift\u00a0+\u00a0P.<br \/>\nIn the\u00a0Command Palette, type\u00a0flutter.<br \/>\nSelect\u00a0Flutter: New Project.<br \/>\nVS Code prompts you to locate the Flutter SDK on your computer.<\/p>\n<p>&nbsp;<\/p>\n<p>If you have the Flutter SDK installed, click\u00a0Locate SDK.<br \/>\nIf you do not have the Flutter SDK installed, click\u00a0Download SDK.<\/p>\n<p>This option sends you the Flutter install page if you have not installed Git as directed in the\u00a0development tools prerequisites.<br \/>\nWhen prompted\u00a0Which Flutter template?, ignore it. Press\u00a0Esc. You can create a test project after checking your development setup.<\/p>\n<p>INSTALL CMAKE (ALSO FOR LINUX APP)<br \/>\nsudo apt install cmake<\/p>\n<p>Launching lib\/main.dart on Linux in debug mode&#8230;<\/p>\n<p>CMake Error: CMake was unable to find a build program corresponding to &#8220;Ninja&#8221;. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.<\/p>\n<p>CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage<\/p>\n<p>Error: Unable to generate build files<\/p>\n<p>INSTALL NINJA BUILD<br \/>\nsudo apt install ninja-build<\/p>\n<p>Launching lib\/main.dart on Linux in debug mode&#8230;<\/p>\n<p>CMake Error at \/usr\/share\/cmake-3.22\/Modules\/CMakeDetermineCXXCompiler.cmake:48 (message):<\/p>\n<p>Could not find compiler set in environment variable CXX:<\/p>\n<p>clang++.<\/p>\n<p>Call Stack (most recent call first):<\/p>\n<p>CMakeLists.txt:3 (project)<\/p>\n<p>2<\/p>\n<p>CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage<\/p>\n<p>Error: Unable to generate build files<\/p>\n<p>ALSO<br \/>\nsatria@teddy:\/opt\/android-studio\/bin$ sudo apt-get install \\<br \/>\nclang cmake git \\<br \/>\nninja-build pkg-config \\<br \/>\nlibgtk-3-dev liblzma-dev \\<br \/>\nlibstdc++-12-dev<br \/>\nBUT GOT<\/p>\n<pre class=\"lang:default decode:true\">...\r\nSome packages could not be installed. This may mean that you have\r\nrequested an impossible situation or if you are using the unstable\r\ndistribution that some required packages have not yet been created\r\nor been moved out of Incoming.\r\nThe following information may help to resolve the situation:\r\n\r\nThe following packages have unmet dependencies:\r\n libcairo2-dev : Depends: libfontconfig1-dev (&gt;= 2.2.95)\r\n                 Depends: libfreetype6-dev (&gt;= 2.1.10)\r\n libgtk-3-dev : Depends: libfontconfig1-dev\r\n libharfbuzz-dev : Depends: libfreetype6-dev\r\n libpango1.0-dev : Depends: libfontconfig-dev (&gt;= 2.13.0) but it is not installable\r\n                   Depends: libfreetype-dev (&gt;= 2.1.7) but it is not installable\r\n libxft-dev : Depends: libfontconfig1-dev\r\n              Depends: libfreetype6-dev\r\nE: Unable to correct problems, you have held broken packages.<\/pre>\n<p>libbrotli-dev : Depends: libbrotli1 (= 1.0.9-2build6)<br \/>\nSOLUTION:<\/p>\n<pre class=\"lang:default decode:true \">sudo apt install libbrotli1=1.0.9-2build6 libfreetype6-dev libfontconfig1-dev libfreetype6-dev libcairo2-dev libgtk-3-dev libharfbuzz-dev libpango1.0-dev libxft-dev<\/pre>\n<p>THEN RE-RUN:<br \/>\nsatria@teddy:\/opt\/android-studio\/bin$ sudo apt-get install \\<br \/>\nclang cmake git \\<br \/>\nninja-build pkg-config \\<br \/>\nlibgtk-3-dev liblzma-dev \\<br \/>\nlibstdc++-12-dev<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/docs.flutter.dev\/get-started\/install\/linux\/android Development tools To develop Flutter on Linux: 1. Verify that you have the following tools installed: bash, file, mkdir, rm, which satria@teddy:~$ which bash file mkdir rm which \/usr\/bin\/bash \/usr\/bin\/file \/usr\/bin\/mkdir \/usr\/bin\/rm \/usr\/bin\/which 2. Install the following packages:\u00a0curl,\u00a0git,\u00a0unzip,\u00a0xz-utils,\u00a0zip,\u00a0libglu1-mesa satria@teddy:~$ sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y satria@teddy:~$ sudo apt-get install -y &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2024\/08\/14\/install-flutter-and-android-studio-on-ubuntu-22-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Flutter and Android Studio on Ubuntu 22.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[140,13,132],"tags":[],"class_list":["post-11996","post","type-post","status-publish","format-standard","hentry","category-flutter","category-tutorial","category-ubuntu-22-04"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/11996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=11996"}],"version-history":[{"count":9,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/11996\/revisions"}],"predecessor-version":[{"id":12005,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/11996\/revisions\/12005"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=11996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=11996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=11996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}