Android Studio keeps selecting an unusable API by default - android-studio

I'm running Android Studio 2.1.2 on Ubuntu 14.04. When installing I chose to download API 24 without thinking and now it gets selected every time I start a new project. Because umake provided Android Studio with JDK 1.7, the Design View always shows an error 'Android N requires JDK 8'.
I can get past this by unchecking 'Automatically Pick Best' and choosing a lower API, but now the Design View is blank. I have to edit the xml and remove the following line;
app:layout_behavior="#string/appbar_scrolling_view_Behavior"
Now I can finally see the Activity I'm building in the Design View.
What I'm looking for is a way to stop Android Studio from always having 'Automatically Pick Best' checked and API 24 selected every time i start a new project. Is this possible? It's a pain to have to go through all those steps each time.

Android Studio installs API 24 by default there is no way around this when you first install (at least that's the way it is with my ubuntu distro - you cannot uncheck API 24 even when you choose to do custom installation settings). sudo umake android
After the install, and before I created a new project I clicked the cog to open 'Configure' which allowed me to open the SDK Manager. In here I was able to install API 23 Marshmallow and delete API 24 Android N.
Now when I create a new project API 23 is selected and the Design View works fine.

Related

cannot find virtual device on android studio 3 windows 10

I am relatively new to Android development and i recently downloaded Android Studio on my Windows 10 machine. But i am facing some problems. When i create a new project, in the activity_main.xml design tab I cannot see any virtual device. All i see is a message that says Design Editor unavailable until successful build. When I click on build,I don't see any message regarding the build in the IDE log. I have the AVD manager installed and i have also created a virtual device.
Also when i edit the RUN configuration, it asks me to select a module but in the drop down window it says no module
**Just update your repositories by clicking on install missing platforms and sync project, i hope that will help **

Android Studio Instant Run not working

I am trying to get Instant Run to work in Android Studio. I have A.S. 2.0 Preview 4 installed, and my Instant Run is enabled like this:
Now, I am experimenting with this in the Topeka sample app from Google (https://github.com/googlesamples/android-topeka). So, I am placing a bunch of Toasts in CategorySelectionActivity and CategorySelectionFragment, hoping that they can be instantaneously changed with Instant Run. But every time I hit the Instant Run button in A.S., it completely shuts down the app and re-installs it. It does not resume from the same activity I was on previously (as expected), NOR is it displaying the toast message like
Applied code changes without Activity restart
Does anyone know how to get Instant Run to work properly?
Thanks,
Igor
Please update Android Studio to Android Studio 2.0 Preview 8.Android Studio 2.0 Preview 8 to the canary channel, as well as a new version of the Gradle plugin: 2.0.0-alpha8. You'll want to update both; instant run in particular is only enabled when using the latest versions of both:
The solution to this problem is to update Android Studio to 2.0 Preview 8, gradle wrapper to:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
and to use this gradle dependency:
classpath 'com.android.tools.build:gradle:2.0.0-alpha8'
Instant run works now on my Mac!

Android Studio won't run application from studio ide?

I've got an application I've been working on and am having an issue with android studio. When I click "build->run" and then select my device, the application never runs on my phone (and the log in android-studio that automatically comes up does not have anything, whereas in the past when I have used this feature it usually says something like, "waiting for phone..." and then the application pops up and automatically opens on the phone and you get some other pertinent information). I have the phone already in developer mode with the install from unknown sources set to on. When I manually move the application from its gradle build location to the phone and then install it manually in file explorer, all is well and the application performs as expected. As I need to debug, however, this is not a very viable solution. Anybody have any advice as to how to get it to run from the IDE? I have tried rebuilding and invalidating the cache/restarting android studio, to no avail.
When I click the run tab at the bottom I have an empty window. When I click the debug tab, I see:
Waiting for device.
Target device: samsung-samsung_sm_g920a-randomIntegerId
Uploading file
local path: /home/eric/Documents/class/OOSE/final_project/2015-group-17/project_code/android/Place2B/app/build/outputs/apk/app-debug.apk
remote path: /data/local/tmp/oose2017.myApp
Note: I am building the application on a LUbuntu 15.04 VM on a windows 8 host, and am using the latest version of android studio.
EDIT: gradle console indicates a successful build as well (obviously since moving the .apk manually to the device works properly).
Open 'Run->Edit Configurations...', and look for your app module in the column on the left-hand side.
Select it, then go to the 'General' tab.
Under the 'Activity' section, there are a couple of radio buttons. Make sure that 'Launch default activity' is selected.

android studio not working well not displaying packages

hey guys im not new to java but this android studio thing, im definitely not used to it,
so i just want to know what packages/tools i need to download from the sdk manager to get me started (im currently dev' apps to be run on api 2.3 gingerbread devices )
From the sdk manager this is what i did,
i downloaded and installed all the latest android sdk build tools,sdk platiform for 4.4 and 5.0
then i also downloaded the whole 2.3 api 10 since its what i was developing for....
after that when i start android studio,just right in the work space where you see the 'package' menu
i get nothing displaying,i mean even all the api i installed i still get nothing.
anybody who been using this tool can gimme help.thx
kind regards C.B!
When you open SDK manager, right click on the .exe and select
"Run As Administrator".
Don't open it from within android studio, find the exe file on your machine. Worked for me when I ran into that problem.
EDIT: You may need to download the sdk separately form here: https://developer.android.com/sdk/index.html?hl=i
Click VIEW ALL DOWNLOADS and pick the appropriate 'sdk only' download for your machine.

livecode Installing app on target - Android

I have a very simple test that I am doing in Livecode Community 6.5, on Windows 8.1.
I have created a button which shows a dialog window when clicked on.
When I run the test in an emulator, the dialog window Standalone Builder Progress reaches the stage "Installing application on target device and then" gets stuck.
Each time I have to terminate LiveCode in the Task Manager. I have tried changing the device but got the same results.
From Android Studio I can see the device when I start AVD.
Make sure that the Platform version of the AVD is the same or higher than the Minimum Android Version in the Standalone Application Settings of your stack.
Try in addition to:
install the latest stable version of LC 6.6.2 from here: LC downloads
make sure you have the Android SDK running with SDK Tools revision 22.6.3 (rev. 23 may not work properly and needs some workaround)
try with using Android 2.3.3 (API 10) - install both SDK Platform and Google APIs
in the Standalone Settings select "Sign for development only" and "Allow External Storage"
if you changed the "Identifier" (default shows as "com.yourcompany.yourapp"), make sure that its contents does not contain any "-" and "&" since they are not working there; possibly change to default.
create a standalone android app (apk) and try to install it on a real device
Thank-you to everyone who helped.
I think 2 things have to be there in order for it to work.
unique Identifier & external storage
Thanks

Resources