Add android target to visual studio for Mac - unity3d

I'm building over a non from scratch project, that a previous developer created in my office.
In a previous version of Unity - Visual Studio for Mac I generated some build for iOS, but now, with the newest version, I get this configuration:
Also, the configuration for Android is disabled.
How I can add Android as target for my project to generate an apk file?
UPDATE 1
VS Configuration.
UPDATE 2 / BUILD CONFING

Please refer to the following link to setup unity to make Android APK:
https://docs.unity3d.com/Manual/android-sdksetup.html
You will need to download: the latest version of java, and the android sdk.
You will need to set the unity path to the sdk
You will need to download and set up the android ndk.
Sounds like a lot of work but its really a lot of waiting. the Android SDK can take some time depending on which versions you wish to support and how far back you go.
Once you have followed the guide above you will be able to change your project to android in the project settings menu.
Good luck!
For mac users with unity looking to set up android:
Instructions for Mac
you should be able to select android here and then click switch platform...

Related

Cant find Android NDK version 21.3.6528147 for unity 2022.1.10f1

I downloaded and installed unity 2022.1.10f1 using links found in :
https://unity3d.com/unity/whats-new/2022.1.10
I am developing for android using windows os,
so I downloaded both unity editor installers:
https://download.unity3d.com/download_unity/9aa0f82c4f96/Windows64EditorInstaller/UnitySetup64.exe
and android target support:
https://download.unity3d.com/download_unity/9aa0f82c4f96/TargetSupportInstaller/UnitySetup-Android-Support-for-Editor-2022.1.10f1.exe
but the problem is, android target support does not include android NDK required for building android apks.
to find what specific version of android NDK required for this release of unity, after launching Unity editor I went to: Edit -> Preferences -> External Tools tab, and I went down to: Android NDK section, unticked "Android NDK installed with unity (recommended), and It shows me the required version of NDK. which in this case is: 21.3.6528147 as shown in the photo here
Unity recommends that I download Unity SDK and all of its relaated modules using Unity Hub: https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe but there are sometimes when you have a limited internet package and you want to download offline installers for unity and modules so that you can re-install them if needed later on.
I looked on the internet for download link for that NDK version, but I can't find it.
I hope you can help.
Thank you
I found the link :
using Android Studio -> configure -> SDK Manager -> Android SDK -> SDK Tools, and then tick on "Show package details", then scroll down to "NDK (side by side)", and then tick on the required version. in my case: 21.3.6528147 as shown in the image bellow
and then press apply. It will bring you a confirmation screen, confirm it. then it will start downloading the file, and will show you a download screen like this screen:
now I can see the correct download link, which in this case is :
https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip
I copied that link and stopped the downloaded. I used an external download manager to download the file and keep it offline. After the download had finished I extracted the file into a directory and set unity to look to that directory for Android NDK. as shown here:
This stopped me for some time, and I thought I should share it with you.
I hope it helps someone.
Thanks
For "Mac M1 Silicon" Download link for NDK (21.3.6528147) is https://dl.google.com/android/repository/android-ndk-r21d-darwin-aarch64.zip

Flutter project on android Studio 4.2.1 no database inspector, profiler and emulator window

Two months and no answer. Am I the only one having this problem?
Yesterday I downloaded and installed Android Studio Arctic Fox 2020.3.1 on my new laptop (Windows 10 64 bit, i7-8565U) and HAVE THE SAME PROBLEM AGAIN!!
Android projects I have all tools, Flutter project missing emulator window, database inspector and profiler!
Android Studio 4.2.1 on Windows 10. Latest stable Flutter version.
If I create an Android project I have all tools: database inspector, profiler and the emulator window.
If I create a Flutter project I have no database inspector, no profiler and no emulator window.
Flutter doctor gives no error.
Everything worked fine until the upgrade to 4.2.1
What's going on? Thank you
I've had this issue and been following this question from the time you posted it. Finally found a solution to it on another SO question.
Solution: Enable the Android Facet It turned out that I had to enable
the Android Facet for this project:
Go to File → Project Structure Choose Facets Press the small + Button
at the top Select Android from the list Confirm your project by
clicking the project_name and press OK
Please check out the full answer here:
https://stackoverflow.com/a/68839489/8362593
I hope it works for you too.
If it's not showing then you can do one thing go to
Help > Find action or ctrl+shift+A > Then search.
Try Windows -> Restore default (Shift+F12 by default)
And also you can specify which windows to show: In bookMark View
I think you might rather have the PATH wrong (which means: using an outdated emulator),
because the emulator now resides in directory called emulator (which wasn't always the case).
This can be easily verified:
emulator -v
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
If you'd get anything less than the current version 30.8.4.0 (despite having installed version 30.8.4.0 with the SDK Manager), you'd know what the actual cause is. Once having fixed the PATH, the proper version of the emulator should become accessible / usable ...and even an upgrade to Arctic Fox should then be possible, at least while the Flutter build.gradle scripts are compatible with Gradle 7.1.1.
Your workaround in words, you probably found this out, and did not bother to document it.
It is just for the next person :-).
Start your flutter app in debug mode.
Select your android folder in flutter project.
Right click -> Flutter -> Open in Android Studio.
Do NO upgrade Gradle Plugin, when suggested.
It might break flutter build and is not needed.
Android Window:
Click Debug Icon.
Wait a bit.
Click something in your app, so your db is active.
Android Window:
Click App Inspection at bottom of android window.
Result:
The Database Inspector shows up, and you can inspect db content in android window.
-- You have to switch between windows, and yes, it is a pain in the but.
-- Flutter plugin and Android integration is lackluster since 2018, but probably very hard to keep up with all that upstream in sync :-(.
Right, basically it doesn't work. That's it. Maybe one day it will. In the meantime I'm using AS 4.1.3 so that I can get all the available tools.
Remember to set environment: sdk: ">=2.12.0 <3.0.0" to have null-safety enabled and to go to Project Structure and set an SDK otherwise you'll get the old ADB.exe file not found when starting the Emulator which means also no Profiler and a bunch of other tools.

Unable to list target platforms Unity 2018.1.0f2

I have a problem when i build / export my game into android's APK.
i've already replace latest tools folder to my SDK path but the problem still don't fixed.
So i tried to upgrade my Unity from 2017.2.0f3 into Unity 2018.1.0f2 and reconfigure my SDK path but still not working.
There's the error notice
Go through Unitys preferences and make sure android SDK Java SDK paths are configured. I had this error recently on a fresh install, the solution was to install https://developer.android.com/studio/releases/platform-tools ( also setting paths to platform tools in your system path can be useful while at it)

Dart SDK is not configured

I installed Flutter and set up Android Studio. Then I cloned an example of flutter on GitHub (https://github.com/flutter/flutter) and launched it in Android Studio, but it warns me "Dart SDK is not configured", this happened to my co-worker as well. But if I create a new project in Android Studio, no problem at all.
What I have done:
Installed Flutter
Installed Android Studio, along with Flutter plugin including Dart plugin
Flutter run in command line works fine, all five tests passed. (See below)
[✓] Flutter (on Mac OS X 10.13.3 17D47, locale en-US, channel dev)
• Flutter version 0.0.22 at /Users/katelyn/flutter
• Framework revision 3001b3307d (7 days ago), 2018-01-30 11:37:15 -0800
• Engine revision 8f2d72b183
• Tools Dart version 2.0.0-dev.16.0
• Engine Dart version 2.0.0-edge.7af4db0ea091dddca6b2da851e6dda8d7f9467e8
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/katelyn/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.4.0
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] Connected devices
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
Last week, I can run their example thru command line (in that dir),
flutter run
but now I it shows some errors with Gradle.
Launching lib/main.dart on Android SDK built for x86 in debug
mode...
Initializing gradle... 0.7s
Resolving dependencies...
Error running Gradle:
Exit code 1 from: /Users/katelyn/AndroidStudioProjects/flutter/examples/flutter_gallery/android/gradlew app:properties:
FAILURE: Build failed with an exception.
Where:
Build file '/Users/katelyn/AndroidStudioProjects/flutter/examples/flutter_gallery/android/app/build.gradle' line: 20
What went wrong:
A problem occurred evaluating project ':app'.
3
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
Please review your Gradle project setup in the android/ folder.
I had the same problem after importing a flutter project from git. These are the steps to solve the problem.
File->Settings->Language & Framework->Flutter
Choose flutter SDK path: the first time we install flutter, we choose the location where the flutter should be installed. Choose this location.
Click OK and the android studio will refresh. Carry on if the problem is solved.
If you are still stuck with the error.
Goto this link and install Dart.
Goto the same place in settings, ..Language & Framework->Dart and chose the SDK location.
This solved the issues for me.
It usually happens with projects that were created in other machines. To fix this on Android Studio 3.1.3:
File-> Settings (ctrl+alt+s)
Languages and Frameworks -> Dart
Check "Enable Dart support for the project..."
In "Dart SDK path" click in "..." and navigate to flutter SDK directory. Under that directory you'll find "bin/cache/dart-sdk". This is the dart sdk path you should use.
Click "Apply"
Close the project and open it again (sometimes you need this step, sometimes doesn't)
Edit 2019-05-28 - I don't know how long this option is enabled but I have noticed that in Android Studio 3.4 it's easier to Enable Dart Support in projects that were developed in other machines.
File -> Sync Project With Gradle Files
After it builds, click in "Enable dart support" in the top of editor panel.
I had the same Dart SDK issue and I used this for my solution. To remedy the issue without having to use the terminal to test my programs each time the steps I followed are as follows.
Find flutter SDK path. I did so by typing in echo $PATH and finding the path with /flutter/bin.
Assuming your path is something like .../flutter/bin just add on /cache/dart-sdk/bin making it .../flutter/bin/cache/dart-sdk/bin.
This .../flutter/bin/cache/dart-sdk/bin is the location of your Dart SDK. Assuming you say the same Dart SDK is not configured error accompanied by something where you can configure your Dart SDK. You click the configure option and set .../flutter/bin/cache/dart-sdk as your SDK. That should fix your problem. If not head over to the next step.
Open your Android Studio preferences(Command + ',') and go to Languages and Frameworks>Dart.
Under the Dart menu, you should be able to enter your Dart SDK path.
I went through these steps using IntelliJ IDEA so they should be pretty much the same. If that didn't work, sometimes making a dummy Dart project can get things working again. That fixed a similar issue for me.
In my machine, flutter was installed in
C:\src\flutter
I set dart sdk path as
C:\src\flutter\bin\cache\dart-sdk
This solved my problem
It may help to use the doctor with -v
flutter doctor -v
for me the result was as
...
Flutter version 2.0.5 at /usr/local/Caskroom/flutter/2.0.5/flutter
...
Then the dart path can be set as
/usr/local/Caskroom/flutter/2.0.5/flutter/bin/cache/dart-sdk
Flutter is usually installed(per illustrations) in.
C:\src\Flutter
For Windows Installations...
You can try running flutter doctor for installation issues.
Also run flutter upgrade to get the latest version of Flutter and Dart SDKs.
DART SDK can be found at
/flutter/bin/cache/dart-sdk
In case other answers didn't work for you
If you are using *nixOS or Mac
Open the terminal and type which flutter. You'll get something like /Users/mac/development/flutter/bin/flutter under that directory go to cache folder here you will find either dart-sdk or (and) dart-sdk.old folder. Copy their paths.
Open preferences by pressing ctrl+alt+s or cmd+, on mac. Under
Language & Frameworks choose Dart find Dart SDK path. Put that
path you've copied at first step to there. Click Apply.
If this didn't solve the issue you have to also set the Flutter SDK path
Under Language & Frameworks choose Flutter and find Flutter SDK path field.
Your flutter SDK path is two step above in the folder hierarchy relative to which which flutter command gave to you. Set it to the field you've found in step 1 of this header. Again click Apply & click save or ok.
Most of the options above have shown how to configure Dart in the Windows System (If you have installed Dart and Flutter Doctor is showing all good).
On MacOS this option is available under Android Studio > Preferences ('Command' + ',')
Locate Languages and Frameworks / Dart in the left pane.
Check Enable Dart Support and locate the dart SDK. It will be inside your Flutter SDK Installation Directory '/flutter-installation-directory/flutter/bin/cache/dart-sdk'. Entering this will auto-populate the dart version in the row beneath, pointing that the framework is picked.
Check the box Enable Dart Support for the following modules for your required project.
Click Apply. Click Ok.
As pointed above also, this should solve most of the use-cases. If error still persists, you can go File > Invalidate Caches/Restart.
I am using Win10 Pro;
If you are using Android Studio and getting this message 'Error: Dart SDK is not found in specified location',
My fix was this.
Go to File/Settings or Ctrl+Alt+S to bring up the settings window.
Go down to 'Language & Frameworks and click on Dart
Check Enable Dart support for the project 'YOUR_PROJECT_NAME'
For the Path Dart SDK path: enter the location where you are storing the flutter directory.
Drill down that directory till you see the Dart SDK directory C:\flutter\bin\cache\dart-sdk. You can also Check SDK update by checking the box and clicking on Check now to get the latest version.
This worked for me.
It normally happens when you are download projects from the github. normally dark sdk contains inside flutter.
you can solve this issue following these few steps
go to the setting using (Ctrl + Shift + s)
go the the Languages & Framework
go to Dart
Enable Dark support for the project
Change the dark sdk path C:\flutter\bin\cache\dart-sdk
Apply
I followed the following steps to solve this problem:
First, Go to: File->Settings->Language & Framework->Flutter
There under the: 'flutter SDK path', put in the location where you have installed Flutter
Mine was at: C:\src\flutter
Click Apply then OK and the android studio will refresh.
The problem will be solved.
Goto preferences -> Languages & Frameworks -> Flutter
Set your flutter sdk path
for example :-
/Users/apple/flutter-sdk/flutter
then apply your settings.
Make sure all dependencies are installed. if not
run - flutter pub get to install dependencies
In case if you getting Warning sign even after selecting the dart-sdk path in an existing project --
-- Close the Android Studio
-- Just delete the .dart_tool folder (mostly the first folder in your
project)
-- Now Open the Android Studio and try to set the path like the techniques showed
above--
File -> Settings -> Languages and Frameworks -> Dart
-- Now Enable the Check Box and set the dart-sdk path, now it will not show that
warning.
And Your project will sync successfully.
Thank You
For mac:
Click Android Studio on top -> Click on Preferences -> Languages & Framework
-> Select Flutter
-> Browse Flutter SDK Path you have download link ["https://flutter.dev/docs/get-started/install/macos"]
-> Click OK
ENJOY!!!!!
I recently faced this issue on my MAC device when I was running flutter project on Android Studio
Steps to fix this.
install dart on MAC os using brew (https://dart.dev/get-dart)
brew tap dart-lang/dart
brew install dart
run
brew info dart
It will give you output something like this
Please note the path to the Dart SDK:/usr/local/opt/dart/libexec
paste the Dart SDK path in Android Studio Settings
for Mac,
Click on Android Studio,
then go to Preferences...
Set your Path inside DART SDK PATH here.
After Enable this for your project(like image show),then apply
A quicker way..
Open up android studio..go the file menu....there u will find Invalidate caches/Restart..click it and respond to the pop up as Invalidate and Restart
Your android studio will get restarted.And its all done.
It really helped me.
Run this command:
$ echo "$(dirname $(which flutter))/cache/dart-sdk"
You'll get something like:
/home/lex/opt/flutter/bin/cache/dart-sdk
Enter that value as your Dart SDK path.
Just go to
File > Settings > Languages & Frameworks > Dart
Click on check box Enable Dart Support for project 'projectName'
Paste the Dart SDK path.
This is how you get Dart SDK path, follow the given steps
copy the Dart SDK Path,
which is in Flutter SDK,
Go to location where your Flutter SDK Situated, then,
Flutter/bin/cache/dart-sdk , till dart-sdk, copy the path and paste it.
OS: Ubuntu 19.04
IntelliJ: 2019.1.2RC
I have read on all the previous answer and after some time trying to get this working I found that the IntelliJ Flutter plugin does not want the path to which flutter instead it needs the base installation folder.
So the 2 steps which fixed:
Install IntelliJ Flutter plugin:
Ctrl + Shift + a (Open Actions)
Type in search 'Flutter' hit enter Install and restart IntelliJ
Configure Flutter Plugin:
Ctrl + Alt + s (Open Settings)
Type in search 'Flutter', Select option under Language & Frameworks
Open terminal which flutter output PATH_TO_FLUTTER/bin/flutter you ONLY NEED the PATH_TO_FLUTTER so remove everything from /bin...
Paste the location on the Flutter SDK path input and apply.
That will then ask you to restart IntelliJ and you should get both Flutter and Dart configured:
Good luck!
In my case Dart also installed separately for dart development with latest. So when IntelliJ suggest me to configure dart, I hit it and then it pointed to C:/tools/dart that was the case.
So, I had to go to File->Settings->Language & Framework->dart and add the SDK path to my Flutter sdk path with Dart SDK C:\flutter\bin\cache\dart-sdk.
Note that as others mentioned if you pointed out the Flutter SDK path, you may not be needed to setup Dart SDK path because of Flutter SDK comes with Dart SDK in it.
The reasons for this error can be either you did not install Flutter or you are using an older version of Flutter 1.21. So it is advisable to check the above things first of all. If none of the above things are the reasons for your error you can follow the below steps and it might help you.
Go to File --> Settings
Then Languages and Frameworks --> Flutter
Flutter SDK path should be empty here. The problem is in here
Copy the Flutter SDK path
Paste it in the empty text field
Apply and OK
Solved mine on macOS by clicking on
IntelliJ IDEA -> Preferences -> Languages & Frameworks -> Flutter
On the SDK Section
Set the Path to your SDK, add path to flutter sdk
see this link for windows https://flutter.dev/docs/get-started/install/windows, for macOS https://flutter.dev/docs/get-started/install/macos and Linux
If not download flutter from this link
Revision of earlier answer to reflect new changes:
Changes since Flutter 1.21
As of Flutter 1.21, the Flutter SDK includes the full Dart SDK.
So if you have Flutter installed, you might not need to explicitly download the Dart SDK, unless:
You don’t use Flutter.
You use a pre-1.21 version of Flutter.
You want to reduce disk space requirements
You want better separation between Dart SDK distribution channels / versions and the one bundled in the Flutter SDK.
Installing the Dart SDK
Personally, as I mostly work on a laptop, I've offloaded my main drive from all the space required by the development tools, moving everything to an external drive as described in this answer
Easy Dart SDK Install
AFAIK, Dart is only dependent on having the $SDK/bin directory available in your systems $PATH variable.
As for installing the SDK itself, both Dart and / or Flutter + Dart I find that downloading a .zip file of the channel (stable, beta or dev) you want, unzip it to a place on your hard-drive and include the path to the SDK /bin directory early in the $PATH is the way to go.
As described in the Dart Documentation
A Possible Problemo
Running commands from the command line is different from within an IDE (or other GUI app), as GUI apps usually store configuration in its own config files, while the various shells store its configuration in shell startup files using amongst other the $PATH variable to decide if it has knowledge of the given application / command. It also defines the order to look for the commands.
Unless the GUI app (IDE in this case) spawns a shell as part of its startup routine and gets the environment populated that way, these two configurations can be totally separate, and point to different tools / paths / utilities.
This would explain the scenario you mentioned:
But if I create a new project in Android Studio, no problem at all.
You can define the environment with the help of the shell's environment in Android Studio via
File -> New Projects Settings -> Settings For New Projects -> Tools -> Terminal
Here you can tell Android Studio which shell the IDE itself should take its environment from (as a path to your login shell of choice), define new variables and make sure the Shell Integration option is enabled.
Now you can have the same (or different if you wish) environments for running, say, pure Dart projects via the Command Line and for Flutter Apps running in the IDE, by picking the values you should already have defined in your shell startup file(s).
Android Studio Configuration
Note: Starting with Android Studio 4.2, the ANDROID_SDK_HOME environment variable is deprecated and has been replaced with ANDROID_PREFS_ROOT
These things are subjects for change, so always check with the Android Studio configuration guide and the
Android SDK Related part of the installation guide before setting these.
It isn't always required, but is a good way for troubleshooting.
similar to above, I got the dart sdk path from a project I created with flutter(not cloned) by going to Android Studio Preferences | Languages & Frameworks | Dart. Then similarly in the cloned project go to Preferences | Languages & Frameworks | Dart and "Enable Dart support for the project..." and enter the path you saved.
On Mac
After trying a bunch of stuff, and several times doing a fresh git clone for the flutter project .. all to no avail, finally the only thing that worked was to download the MacOS .zip file and do a fresh install that way
https://flutter.dev/docs/get-started/install/macos
After installing Flutter, the best way to install Dart sdk is by creating a new project. In this window, click INSTALL SDK. This installs all necessary to work properly.
In my case it was updating flutter sdk path in android studio, preferences.
I solved it, try:
Click on open SDK settings and open Flutter and then add SDK location when your download.
In fact, it's a good habit to check your settings before you run the app.
Have you check the java SDK path ?(in fact, if you have already run another app but failed to run this, which might be download from Github or others.
then you might have to check the flutter settings and the dart settings.

Appcelerator Titanium: Android SDK doesn't load

I started developing with Titanium and now I really stuck on one part.
I downloaded the Adroid SDK and added the path to Titanium:
/Users/michael/Downloads/android-sdk-mac_86/
I can open e.g. Kitchen Sink in the iPhone Simulator without problems, but when I want to open it in Android then my screen looks like this: Screenshot
Why is down there all the time, even after 2 hours of waiting, the label "loading..." ?
some great advice given here - helped me out.
Switching to TRACE will probably show that Android SDK Platform 1.6 and API 4 is missing.
More info here
1) You can install Android SDK 1.6 (run tools/android from your Android SDK folder and download the older SDK 1.6 from the Google Repository),
and Titanium will detect Android SDK
2) As for Android SDK 2.2, adb moved to platform-tools folder, so you will have to create a link in [your-android-sdk-folder]/tools e.g. :
ln -s ../platform-tools/adb
(full instructions for non-linux here : http://guides.appcelerator.com/en/getting_started.html)
Finally, in the Titanium Test&Package/Run emulator window, you will have the choice between Android SDK 1.6 and 2.2
Try to open your Android_SDK_Dir/tools, run file android to create a new Android Virtual Device. After that, open your Titanium again. Maybe this will solve your issue.
Take a look at your image. Value of SDK listbox is "...loading...". This means you Titanium cannot determine which Android Virtual Device is. So, as I said, try to create new Android Virtual Device first.
having the same issue - have you found a workaround?
found out that after downloading the android sdk - there are other components to be downloaded, which is different from previous versions. Also found some implication that loading the android emulator prior to launching the app from titanium may yield better results.
check the android docs for updating the sdk via the avd manager
load the emulator first video:
http://vimeo.com/10866226
Try setting the Filter from "Info" to "Trace" that may illuminate things.
Most commonly, you may not have the right platforms installed. Just install all of them if that's the case.
add a blank folder android-7 in android/platforms ..n restart titanium ..it worked for me on ubuntu