6,326 questions
1081
votes
36
answers
797k
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 ...
173
votes
15
answers
293k
views
How to enable multidexing with the new Android Multidex support library
I want to use the new Multidex support library to break the method limit for one of my apps.
With Android Lollipop Google introduced a multidex support library that makes it easy to multidex.
What ...
843
votes
23
answers
1.0m
views
How to add local .jar file dependency to build.gradle file?
I have tried to add my local .jar file dependency to my build.gradle file:
apply plugin: 'java'
sourceSets {
main {
java {
srcDir 'src/model'
}
}
}
dependencies {
...
861
votes
17
answers
974k
views
Using Gradle to find dependency tree
Is it possible to use Gradle to produce a tree of what depends on what?
I have a project and would like to find out all the dependencies so I may be able to prune it a little with forward declarations ...
1300
votes
12
answers
553k
views
What's the difference between "implementation", "api" 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 ...
52
votes
5
answers
68k
views
React Native Android build failure with different errors without any changes in code for past days due to publish of React Native version 0.71.0-rc.0
Note: Error may be different but if you are getting any error when taking android build without any changes in code for past two days
My Error - Failed to install the app. Error: Command failed: ./...
577
votes
24
answers
948k
views
How do I tell Gradle to use specific JDK version?
I can't figure out to get this working.
Scenario:
I have an application built with gradle
The application uses JavaFX
What I want
Use a variable (defined per developer machine) which points to an ...
543
votes
29
answers
565k
views
How to manually include external aar package using Gradle for Android
I've been experimenting with the new android build system and I've run into a small issue. I've compiled my own aar package of ActionBarSherlock which I've called 'actionbarsherlock.aar'. What I'm ...
807
votes
24
answers
561k
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 project
Set minimum SDK 4.0 (...
216
votes
26
answers
174k
views
Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat
If I run gradle assembleDebug from the command line, I am suddenly getting this error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.util.DexException: Multiple dex files define Landroid/support/v4/...
136
votes
23
answers
138k
views
Java finished with non-zero exit value 2 - Android Gradle
I'm getting this error executing my Android app (I cleaned it and then built it, but the error is still present)
Sync: OK
Make Project: OK
Clean: OK
Run: Error
Error:Execution failed for task ':app:...
633
votes
20
answers
216k
views
Can the Android layout folder contain subfolders?
Right now, I'm storing every XML layout file inside the 'res/layout' folder, so it is feasible and simple to manage small projects, but when there is a case of large and heavy projects, then there ...
166
votes
14
answers
242k
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 found
What can be wrong?
I use Android Studio 1....
477
votes
18
answers
1.1m
views
How to update Gradle in Android Studio?
I installed Android Studio 0.1.9. Today I got and update to version 0.2 and of course I updated. After the installation I restarted Android Studio but now I get this message:
Project is using an old ...
14
votes
4
answers
7k
views
DexIndexOverflowException Only When Running Tests
I can successfully build and run my Android app in my debug and release variants with no problem. Yet, when I try to run my new unit tests (I never had them before), I get the dreaded ...