Questions tagged [android-studio]

Use for questions about using Android Studio, an official IDE targeted at Android development. Do NOT use for questions about programming for Android in general; instead use [tag:android].

729
votes
30answers
583k views

How do I add a library project to Android Studio?

How do I add a library project (such as Sherlock ABS) to Android Studio? (Not to the old ADT Eclipse-based bundle, but to the new Android Studio.)
753
votes
39answers
599k views

You need to use a Theme.AppCompat theme (or descendant) with this activity

Android Studio 0.4.5Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.htmlIf you want a custom dialog, you can instead display an ...
906
votes
34answers
666k views

Android Studio: Add jar as library?

I'm trying to use the new Android Studio but I can't seem to get it working correctly.I'm using the Gson library to serialize/deserialize JSON-objects. But the library somehow isn't included in the ...
304
votes
12answers
239k views

How can I use external JARs in an Android project?

I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then added the JAR to the build path and checked it off in Order and Export.Order and Export is ...
891
votes
41answers
531k views

Android Studio Rename Package

How do you rename packages in new IDE Android Studio, based on intelijj ?Is there any automatic refactoring included? I want to make bulk refactoring but I don't know how. I worked 2 years with ...
531
votes
68answers
847k views

“cannot resolve symbol R” in Android Studio

In every instance in all of my classes where I reference R.id.something, the R is in red and it says "cannot resolve symbol R". Also every time there is R.layout.something it is underlined in red and ...
457
votes
38answers
180k views

All com.android.support libraries must use the exact same version specification

After updating to android studio 2.3 I got this error message.I know it's just a hint as the app run normally but it's really strange.All com.android.support libraries must use the exact same ...
710
votes
23answers
513k views

Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

I've always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then:Started a new projectSet minimum SDK 4.0 (...
112
votes
6answers
149k views

OpenCV in Android Studio

I want to use OpenCV library in my app with Android Studio. I followed instructions found here but I get error Configuration with name 'default' not foundWhat can be wrong?I use Android Studio ...
344
votes
31answers
383k views

How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

I have shifted myself from Eclipse to Android Studio. Now I am trying to work on my Map app. So I need my SHA-1 fingerprint certificate number.When I was using Eclipse it was right under Windows -> ...
341
votes
29answers
350k views

Android Studio installation on Windows 7 fails, no JDK found

I downloaded Android Studio and attempted to launch the program.This is running on Windows 7 64-bit with Java 1.7. During the installation my Java 1.7 is detected, and the rest of the installation ...
61
votes
9answers
89k views

Failed to resolve: com.android.support:appcompat-v7:26.0.0

I am having this issue in Android studio.Error:(22, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0<a href="http://stackoverflow.com.mevn.net/install.m2.repo">Install Repository and sync project</a><br&...
1157
votes
19answers
441k views

Where do I place the 'assets' folder in Android Studio?

I am confused about the assets folder. It doesn't come auto-created in Android Studio, and almost all the forums in which this is discussed talk about Eclipse.How can the Assets directory be ...
148
votes
6answers
102k views

Instant run in Android Studio 2.0 (how to turn off)

How to disable Instant Run in Android Studio 2.0 Preview. When I go to the settings I see it:and I can not remove the tick from "Enable Instant Run..."I use Android Studio 2.0 Preview 9, but this ...
456
votes
27answers
741k views

Android Studio - How to Change Android SDK Path

When I open Android SDK Manager from Android Studio, the SDK Path displayed is:\android-studio\sdkI want to change this path. How do I do it?
165
votes
23answers
210k views

Android Studio suddenly cannot resolve symbols

Android Studio 0.4.2 was working fine and today I opened it and almost everything was red and the auto-completion had stopped working. I look at the imports and AS seems to be telling me it can't find ...
1040
votes
28answers
368k views

What should be in my .gitignore for an Android Studio project?

What files should be in my .gitignore for an Android Studio project?I've seen several examples that all include .iml but IntelliJ docs say that .iml must be included in your source control.
342
votes
5answers
202k views

How to completely uninstall Android Studio?

I recently downloaded Android Studio on my Macbook Pro and I messed up with it every time I open it. It gives me plugin errors and several other errors. I need to uninstall it completely from my mac. ...
310
votes
20answers
120k views

Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”

Using Android Gradle plugin 0.7.0 with the following build.gradle:buildscript {repositories {mavenCentral()}dependencies {classpath 'com.android.tools.build:gradle:...
74
votes
15answers
250k views

Adding external library in Android studio

I want to add external library https://github.com/foursquare/foursquare-android-oauth to my Android application (I use Android Studio, the instructions provided by lib author for Eclipse didn't work ...
436
votes
27answers
211k views

Building and running app via Gradle and Android Studio is slower than via Eclipse

I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app, which is extremely slow....
480
votes
1answer
210k views

Mipmaps vs. drawable folders [duplicate]

I'm working with Android Studio 1.1 Preview 1. I noticed that when I create a new project I'm getting the following hierarchy:Mipmap folders for different DPIs, no more different DPIs drawable ...
340
votes
13answers
503k views

Changing API level Android Studio

I want to change the minimum SDK version in Android Studio from API 12 to API 14. I have tried changing it in the manifest file, i.e.,<uses-sdkandroid:minSdkVersion="14"android:...
327
votes
4answers
95k views

Is it possible to declare a variable in Gradle usable in Java?

Is it possible to declare a variable in Gradle usable in Java ?Basically I would like to declare some vars in the build.gradle and then getting it (obviously) at build time. Just like a pre-processor ...
63
votes
4answers
26k views

Failed to resolve: com.google.firebase:firebase-core:11.2.0

I'm getting multiple "Failed to Resolve" issues when syncing my project. They are all firebase and play-services related. I made sure they are all the same (11.2.0). I've also checked and the latest ...
100
votes
12answers
140k views

using facebook sdk in Android studio

I'm following Facebook SDK for Android using Android Studio. When I run my application I'm getting the below mentioned warning.Gradle: module 'facebook' won't be compiled. Unfortunately you can't ...
299
votes
21answers
449k views

HttpClient won't import in Android Studio

I have a simple class written in Android Studio:package com.mysite.myapp;import org.apache.http.client.HttpClient;public class Whatever {public void headBangingAgainstTheWallExample () {...
125
votes
6answers
76k views

Android studio add external project to build.gradle

I have a sample project, with the following setup:/root+ Pure Java Lib+ Android Test Lib+ Android Test ProjectWhere the 'Test Project' is dependent on the 'Test Lib', and the last depends ...
470
votes
5answers
97k views

What's the difference between implementation and compile in gradle

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of ...
63
votes
22answers
139k views

Error:Execution failed for task ':app:transformClassesWithDexForDebug'

The errorError:Execution failed for task ':app:transformClassesWithDexForDebug'.com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,