Menu
  • HOME
  • TAGS

Android build project error trying to build apps > 65K (65536) methods

android,android-studio,gradle,build,android-gradle

You need to reduce the size or include only the imports you need to for your application. You are hitting the dex limit of 65536 methods. Here's the link Building Apps with Over 65K Methods which might help....

ProcessException: ExecException: Process 'command ' /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Content/Home/bin/java

java,android,android-studio,android-gradle,build.gradle

Your solution is here. More specifically at the "Selectively compiling APIs into your executable" section here. By using com.google.android.gms:play-services:7.5.0, you are compiling with all Google Play services APIs. You should use the Google Play services APIs that you need. For example, if you need Google+, then you use, com.google.android.gms:play-services-plus:7.5.0 Hope...

android studio “Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly”

android-studio,gradle,android-gradle

Have you had the project compile / work before? If so the issue is most likely your XML files having issues. Also try to make clean and make sure all of your dependencies are correct if you imported any. You haven't given much info besides the error code about your...

Automatically Migrating projects to gradle in Android studio

android,android-studio,android-gradle

IMPORTING ANDROID STUDIO PROJECT IN ANDROID STUDIO: If you want to import An Android Studio Project then do the following: 1. Select Open an existing Android Studio Project 2. Browse your desired project derectory. 3. Now rather than selecting the folder that contains your project, you have to select the...

java.exe finished with non-zero exit value 2

android,dependencies,android-gradle

No one answered. I found.... The solution is multidex public class MyApplication extends MultiDexApplication { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } } in menifest file <application android:name=".MyApplication" android:allowBackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:largeHeap="true" android:theme="@style/Theme.MyAppTheme"> My gradle file android { compileSdkVersion 21 buildToolsVersion "22.0.1" defaultConfig {...

Gradle - Executor singleton not started

android,gradle,android-gradle,gradlew

I was using Gradle Daemon to speed up the builds, I suspected the exception had something to do with the Daemon so I restarted it and now it's working fine. Here's the command to stop the daemon : ./gradlew --stop The next time you do a build it starts automatically....

How to declare a constant that is visible to all modules' build.gradle file?

android,gradle,android-gradle

The way I choose to do something similar is to create a properties file and then just read that for all my global variables. You can do this with java syntax: Properties props = new Properties() props.load(new FileInputStream("/path/file.properties")) A more groovy like syntax is that's what you perfer is: Properties...

What is the best way to find out new version is available for external libraries used in Android Studio project

android,maven,android-studio,android-gradle,jcenter

There is a lint option called "Newer Library Versions Available". You may need to add this to your build.gradle as well: android { ... lintOptions { warning 'NewerVersionAvailable' } } Then you can run Analyze > Run Inspection By Name... > Newer Library Versions Available to get a list of...

apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog

android,android-studio,android-gradle

I already had long ago successfully used build variants to upload to Google Play Store (GPS) 'debug' apks for both free and full version of app for beta testing. That wasn't the question. The question was whether I need to knock myself out to produce 'release' apks (how to do...

How do I get this project structure in Android Studio (AS) 1.1.0 to work to produce two APKs?

android,android-gradle

Everything related to your flavors should be inside the src folder, e.g. src/main/... src/free/... src/pro/... Right now your src folder is at the same levels as the flavor folders, which is incorrect. See this documentation for confirmation of the above....

Gradle is stuck on mergeDebugAssets, doesn't even fail

android,android-gradle

The real problem is not that the process is stuck, but that my project is so large, that one single change took more than an hour for the build to finish successfully. Now I have to investigate why my project is so big, but that's out of the scope of...

Android Studio - Failed to resolve: com.android.support libraries

android,android-gradle,android-sdk-manager

You need to add these to your build.gradle file dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:recyclerview-v7:22.1.1' compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:support-v4:22.1.1' } ...

How to update project using gradle automatically when executing sonar-runner?

android,sonarqube,android-gradle,lint,sonar-runner

Simply add a new line to module build.gradle file, just after sonarRunner task declaration: sonarRunner { tasks.sonarRunner.dependsOn build // <- This new line sonarProperties { ...

Android Studio with AndroidAnnotations NoClassDefFoundError

java,android,android-studio,android-gradle,android-annotations

The problem is with multiDexEnabled true It is only supported on Android 5 natively. So I need a library for this to run in older versions. I found the fix....

java.lang.NoClassDefFoundError on android studio

java,android,gradle,android-gradle,noclassdeffounderror

I found the problem, I am using MultidexSupport because I have a lot of libraries. Multidexsupport in grade file is only supported in andorid api21(lollipop). Found this tutorial that helped me get api 19 support: http://frogermcs.github.io/MultiDex-solution-for-64k-limit-in-Dalvik/...

Gradle Build Failure

android,android-gradle,release,build.gradle

Turns out I had omitted the getDefaultProguardFile('proguard-android.txt') line on the proguard files and was just using proguard-rules.pro

Travis CI for Android - Build Error: Failed to find target & Could not find dependencies

android,android-gradle,travis-ci

You need to update the build tools to the version 22.X, I have tried in my project configuration and that works. android: components: - android-22 - build-tools-22.0.1 ...

Generate custom package names for Android apps with Gradle

android,android-gradle

I finally found a workaround. Here is what I did : android { ... buildTypes { prod.initWith(buildTypes.release) prod { } uat.initWith(buildTypes.debug) uat { } } productFlavors { demo { applicationId "com.demo" } demo1 { applicationId "com.demo1" } } } task editApplicationId { android.applicationVariants.all { variant -> variant.mergedFlavor.applicationId = variant.mergedFlavor.applicationId +...

Issue building project on Android Studio - support-v4

android,gradle,android-gradle,build.gradle

Alrighty the solution was to update gradle on build.gradle of my project, not module // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } allprojects { repositories { jcenter() } } it was set...

Error in gradle: Design Navigation Library include

android,android-gradle,navigation-drawer,androiddesignsupport

Update your Android Support Library and Android Support Repository.

How to change the default artifactId of maven-metadata.xml when uploading to bintray

gradle,android-gradle,bintray,jcenter

The files aren't named correctly. You have transition-0.8.0.aar, so the artifactId can't be core. If you want everything to be core, you need to rename the project, changing the pom is not enough.

Gradle: Execution failed for task ':*application-name-here*:compileDebugNdk', where can I see the adequate error messages?

android,intellij-idea,gradle,android-ndk,android-gradle

You can get the error messages thrown back by ndk-build through Android Studio "Messages" and the Gradle Console: ...

Can't build project after adding RxJava to dependencies

java,android,android-gradle,rx-java

Taking into account the number of dependencies you have in your build.gradle, the most possible reason for having this error is an androids 65k methods limit. There are several ways to fix the error, which are described in the official documentation. I think the easiest way is to get rid...

Gradle Android Project with Java 8 module

java,android,gradle,java-8,android-gradle

Android can support java 1.7 since API 19 (as you see in this doc there is no mention of java 1.8) and also it doesn't use JVM and using ART or Dalvik instead ,So it generates Dalvik bytecode. I think if we want to use java 1.8 as compileOptions maybe...

MultiDex issue - Execution failed for task ':app:dexDebug'

android,google-api,google-calendar,android-gradle,build.gradle

When you add the multidex:true don't forget to make an Application class in your project that extends from the MultiDexApplication or a lot of bad stuff will happen public class YourApplication extends MultiDexApplication { .......... } And don't forget this either (the version may change over time, if you read...

Findbugs android gradle plugin

android,android-gradle,build.gradle,findbugs,gradlew

Just place this in your modules build.gradle. apply plugin: 'findbugs' task customFindbugs(type: FindBugs) { ignoreFailures = false effort = "max" reportLevel = "low" classes = files("$project.buildDir/intermediates/classes") //Use this only if you want exclude some errors excludeFilter = file("$rootProject.rootDir/config/findbugs/exclude.xml") source = fileTree('src/main/java/') classpath = files() reports { xml.enabled = false xml.withMessages...

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

android,android-studio,gradle,android-gradle

Just like CommonsWare suggested, make sure you have Gradle 2.2.1+ (the latest is 2.3). Make sure you upgrade your Android Studio but here are the "plugins" that need to be updated: Top build.gradle: Change: classpath 'com.android.tools.build:gradle:1.1.0-rc1' To: classpath 'com.android.tools.build:gradle:1.1.3' // latest 1.2.3 App build.gradle: Change: compile 'com.android.support:recyclerview-v7:21.0.0' compile 'com.android.support:cardview-v7:21.0.0' To:...

How do I add a dependency to the android gradle task 'test'?

gradle,android-gradle

Solution: Wrap it in afterEvaluate { test.dependsOn 'mytask' } ...

How to download a library dependence on gradle for external use?

cordova,android-studio,gradle,android-gradle,cordova-plugins

What you're looking for is an aar file. You can copy this file to lib folder with the following script: apply plugin: 'java' repositories { mavenCentral() } dependencies { compile 'io.filepicker:filepicker-android:[email protected]' } task copyLibs(type: Copy) { from configurations.compile into 'lib' } ...

Gradle project sync failed. Basic functionality will not work properly

android-studio,android-gradle

This is a confirmed bug with Android Studio 1.2: https://code.google.com/p/android/issues/detail?id=160899 The main solution is to wait for their fix. I have had luck re-importing the project, but I have to do it every time I open the project....

How to add Android Studio plugin as dependency in Gradle?

android-studio,gradle,testng,android-gradle,build.gradle

Use TestNG 6.9.4, which is distributed on both JCenter and Maven (6.3.1 is on Maven Central only, which you don't seem to have in your repositories list).

Cannot find symbol import com.twitter.sdk.android.Twitter using Fabric

android,twitter,android-studio,android-gradle,twitter-fabric

Replace twitter-core in this line below compile('com.twitter.sdk.android:twitter-core:[email protected]') { transitive = true; } with twitter so it would look like this compile('com.twitter.sdk.android:twitter:[email protected]') { transitive = true; } ...

android gradle build set class attribute value

android,android-studio,android-gradle,build.gradle

You can write your fields inside BuildConfig class and then get them from there. productFlavors { myApp { buildConfigField "String", "URL", "\"someurl.com\"" } } public class MyApplication extends Application { private String URL; @Override public void onCreate() { URL = BuildConfig.URL; } } ...

Build failed after updating SDK tools and plays services libraries

android,gradle,android-gradle,build.gradle

By the look of it the attributes you are using ie error: Attribute "track" has already been defined error: Attribute "thumbTextPadding" has already been defined error: Attribute "switchMinWidth" has already been defined error: Attribute "switchPadding" has already been defined might being used by the M-Preview SDK.Just change your attributes of...

Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:

java,android,android-studio,android-gradle,build.gradle

Welcome. You are at the first step of Android gradle hell. Update your Android SDK components in SDK Manager to latest one including Extra > Google Repository (recommend to add almost all in Extra). Let's wash up your current file. AndroidManifest.xml: Remove the <uses-sdk ... /> lines. It's redundant as...

Issue with gradle flavor with folder name for custom src folder

android,android-gradle,build.gradle

Here is an example how you can easily implement it. SpecificParameter.java public class SpecificParameter { public static ParameterType getParameter() { return parameter; } } and in your buildConfigField, you can set the parameter like, parameter = SpecificParameter.getParameter(); and put 4 SpecificParameter.java to your flavor packages. This way your flavors will...

Android Gradle fails to build after clean (depends on AAR with native libraries)

android-gradle

The reason this happened was because the dependency line changed, and was no longer right. I cannot figure out why it would work after one build, but not after a clean. The error message isn't clear! Even though the artifact didn't exist according to the dependency declaration, it would pass...

Android Studio incorrect package name

android,eclipse,android-studio,android-gradle,packages

My problem was that I was looking at the wrong build.gradle file and didn't see the application id value. Once I found the correct file (thanks to @ianhanniballake) I changed the application id and it worked.

Android Studio gradle build cannot add dependencies on old build gradle file

java,android,eclipse,android-studio,android-gradle

I solved my problem by getting nightly builds of Libgdx, create a new project and copy the source from old project. Then import the Android libraries by Android Studio. I think it's because of new Gradle version.

Android Build with Gradle and ProGuard : “The output jar must be specified after an input jar, or it will be empty”

android,gradle,android-gradle,proguard,android-progaurd

It took quite a while for me to figure it out but as I guessed It was all about proguard configuration. I want to answer my own question, so in the case someone else gets the same issue, this could provide a solution. I started to dig through the Warnings...

How can I add something to the productFlavors which I can read from java code

android,android-gradle,build.gradle,android-productflavors

Found a more simple solution productFlavors { GooglePlay { buildConfigField "String", "ChannelName", "\"GooglePlay\"" } Amazon { buildConfigField "String", "ChannelName", "\"Amazon \"" } } Then access the channel name via BuildConfig.ChannelName...

Build Failure on Android Studio

android,compilation,compiler-errors,android-gradle,build.gradle

Play services is a big library with tens of thousands of methods that will eat into your dex limit. Its better to replace the play services imports with just the parts you need. From version 6.5, you can instead selectively compile Google Play service APIs into your app. Google+ com.google.android.gms:play-services-plus:7.5.0...

Gradle :app:preDexDebug error Android Studio Project

android,android-studio,android-gradle,build.gradle

The problem is compiling. Change compile options to Java 6. compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 targetCompatibility JavaVersion.VERSION_1_6 } ...

Android studio gradle flavor dimensions build varients not working correctly

android-studio,gradle,android-gradle,build.gradle,android-productflavors

I think you misunderstood the concept of flavorDimension. A flavorDimension is something like a flavor category and every combination of a flavor from each dimension will produce a variant. In your case, you must define one flavorDimension named "type" and another dimension named "organization". It will produce, for each flavor...

Warning about an Android Library project gradle dependencies

android,android-studio,gradle,android-gradle,build.gradle

I want the user of the .aar file to be notified/warned about .aar dependencies so his project doesn't successfully builds till these dependencies are set inside his project. Well, to some extent, that would happen automatically, as their compile would fail. If you distribute this AAR as an artifact...

BuildConfig Failure error ';' expected

android,android-gradle,buildconfig

Based on your BuildConfig.java, these Strings need to have quotes: public static final String API_CLIENT_ID = "fd8drdsgdsgsd4"; public static final String API_CLIENT_SECRET = "5d4f9adab5zdfhfdxzxdfbdbc72a18087ce"; The original project on Github looks like this: buildConfigField "String", "API_CLIENT_ID", project.API_CLIENT_ID buildConfigField "String", "API_CLIENT_SECRET", project.API_CLIENT_SECRET The project. means that API_CLIENT_ID and API_CLIENT_SECRET are defined in...

Getting an OOM issue on the setContentView call in a java gradle android project

java,android,intellij-idea,out-of-memory,android-gradle

You can add this line to application class declaration into manifest file to request a larger heap size. android:largeHeap="true" Make change into manifest file code. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.thenewjonathan.gloryblades" > <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission...

Failed to resolve com.melnykov:floatingactionbutton:1.3.0 in gradle

android,android-studio,gradle,android-gradle,build.gradle

You have to add the repository from which gradle should download the aar. repositories { jcenter() } Without this part, gradle doesn't know where to find the dependencies. The other libraries doesn't need the repo because are a local jar (in the lib folder): compile files('libs/opencsv-3.1.jar') or a local maven...

Gradle build error with Simpleframework

gradle,dependencies,android-gradle,build.gradle,simple-framework

I solved this problem. I add a configurations to my application project. So my application build.gradle file is below. configurations { compile.exclude module: 'stax' compile.exclude module: 'stax-api' compile.exclude module: 'xpp3' } dependencies { compile 'com.android.support:support-v4:19.+' compile 'com.google.android.gms:play-services:5.+' compile 'com.jakewharton:butterknife:5.1.2' compile 'com.jakewharton.timber:timber:3.1.0' compile 'commons-io:commons-io:2.4' compile 'commons-net:commons-net:3.3' compile...

Android - Only execute Gradle task on release build variant

android,android-gradle,build.gradle

try#3 android.applicationVariants.all { v -> if (v.buildType.name == "release"){ v.assemble.doLast { logger.lifecycle("we have successfully built $v.name and can post a messaage to remote server") } } } ...

Where to put Gradle 2.2.1 manually

android,android-studio,android-gradle

Yes download the file manually from the gradle Homepage and then it really doesn't matter where you put the file. Just unzip the file to any directory on you workstation e.g., where you have your programms - and then in android studio you go File -> Settings -> Build execution...

Why does Android Studio say “Test events were not received”?

unit-testing,android-studio,junit,gradle,android-gradle

I assume you're using Android Studio version 1.2, the latest at this time. I don't think anything is wrong with your code. According to Jason Atwood's post, the problem seems related to gradle caching the previous results and not running it again. If you look at the "Gradle console", you'll...

APK file creation in Android Studio

android,android-studio,apk,generator,android-gradle

It actually does create APK file, but not in the root project directory. It does create it on the path project_root/module_name/build/output/apk/ Try searching for APK files in the project root directory with subdirs, and you'll find them and understand what I mean

How to Install Google Play Services GMS SDK on CircleCI

android,linux,gradle,android-gradle,circleci

The solution after much tweaking seems to require you to explicitly specify the components you need in the --filter option. If you don't add filter, it appears that --all will NOT give you all the components needed. Fix is below for others: ssh dependencies: pre: - echo y | sudo...

how to use renderscriptSupportModeEnabled?

android,android-imageview,android-gradle,android-library,renderscript

You have to delete the lib because it might be doubled

Error:(10, 0) gradle method not found classpath()

android,facebook,gradle,android-gradle,build.gradle

You have to include this part in the buildscript block dependencies { classpath 'com.android.tools.build:gradle:1.1.3' } Should be: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.1.3' } } ...

IDEA - Not detecting changes in build.gradle

intellij-idea,android-studio,gradle,android-gradle

In most cases, the gradle is simply not refreshed or not configured properly. Go to your gradle task bar (Mine is situated on the right hand side of the screen) and press the refresh icon to get it back

Why do some tasks in Gradle not show up as properties?

gradle,android-gradle

It happens because some tasks are created during script evaluation, hence they are not available at configuration time but at runtime only. I'm not sure about syntax (and if it's possible to define dependency at this level od evaluation) but try: project.afterEvaluate { assembleAmazonDebug.dependsOn info } It will define the...

Understanding different variants of declaring a task in Gradle

android-studio,gradle,task,android-gradle,build.gradle

Gradle build goes through 3 phases: Initialization - determine which projects are going to take part in the build, and creates a Project instance for each of these projects. Configuration - configure project objects and specifically the tasks to be executed. Execution - executing the subset of the tasks created...

How to make dependency transitive in Gradle

maven,javamail,android-gradle,build.gradle,gmail-api

The javax.mail-api-1.5.3 can also be downloaded from existing repositories (probably jCenter or mavenCentral) described in your build file. If you aren't tied to using your downloaded version in /libs, you might do this in your build file: dependency { compile 'javax.mail:javax.mail-api:1.5.3' } The default behavior in this case is to...

What's the difference between buildscript and allprojects in build.gradle?

gradle,android-gradle

The "buildscript" configuration section is for gradle itself (i.e. changes to how gradle is able to perform the build). So this section will usually include the Android Gradle plugin. The "allprojects" section is for the modules being built by Gradle. Oftentimes the repository section is the same for both, since...

Define buildconfigfield for an specific flavor AND buildType

android,gradle,android-gradle,build-tools

Loop the variants and check their names: productFlavors { vanilla {} chocolate {} } applicationVariants.all { variant -> println("Iterating variant: " + variant.getName()) if (variant.getName() == "chocolateDebug") { variant.buildConfigField "boolean", "VARIABLE", "true" } else { variant.buildConfigField "boolean", "VARIABLE", "false" } } ...

How to compile JAR for the SuperSLiM library?

android,xamarin,android-gradle,build.gradle,superslim

I've just created the necessary bindings, you can check out the (pretty simple) binding project on https://github.com/dmunch/SuperSLiM-binding or download the NuGet at https://www.nuget.org/packages/SuperSLiM/

how to solve this error aapt.exe

android,debugging,android-gradle

Have you tried to move the ic_launcher in mipmap-... folders? If not try to create mipmap forlders for all the resolutions and move the ic_launcher.png files into them (make sure they are removed from drawable folders. Also don't forget to change the reference in the android manifest file :-)...

What is the default for minifyEnabled for buildType not explicitly scripted?

android-studio,gradle,android-gradle,proguard,minify

The default value for minifyEnabled is false for all build types, as @laalto answered. However, currently (as of 2015-04-24), this is not true for multi-module projects, in which some modules (app included) are dependent on other modules. This is due to bug #52962 that causes build types to not propagate...

Auto increment versioncode only on releases

android,gradle,android-gradle

You could try something like that import java.util.regex.Pattern task('increaseVersionCode') << { ... // You could code in your increment system, for eg // Using build.gradle (recommended) def buildFile = file("build.gradle") def pattern = Pattern.compile("versionCode\\s+(\\d+)") def manifestText = buildFile.getText() def matcher = pattern.matcher(manifestText) matcher.find() def versionCode = Integer.parseInt(matcher.group(1)) def manifestContent =...

Android: Managing different server Url for development and release

android,android-gradle

If you are using Android Studio, use buildConfigField to add custom fields to your BuildConfig class. buildTypes { debug { buildConfigField "String", "SERVER_URL", '"http://test.this-is-so-fake.com"' } release { buildConfigField "String", "SERVER_URL", '"http://prod.this-is-so-fake.com"' } mezzanine.initWith(buildTypes.release) mezzanine { buildConfigField "String", "SERVER_URL", '"http://stage.this-is-so-fake.com"' } } Here, I have three build types: the standard debug...

Build library jar with Gradle

android,gradle,sdk,android-gradle

You need to create a new gradle task, similar to mine task clearJar(type: Delete) { delete '../location/' + LIBRARY_NAME + '_' + LIBRARY_VERSION + '.jar' } task makeJar(type: Copy) { dependsOn clearJar, build from 'build/intermediates/bundles/release/' into '../../location/' include 'classes.jar' rename 'classes.jar', LIBRARY_NAME + '_' + LIBRARY_VERSION + '.jar' } Where...

How to Import Github non Android Studio Project as library into Android Studio?

android-studio,android-gradle,android-standout

I followed the answer of sbr1308 but I have to do some more things.What you have to do: Go to Android Studio File->Project Structure-> + , You will get four options to add a new module. From there choose "Import Existing Project"->Next-> browse to the directory you have downloaded library...

Android - gradle.properties windows

android-gradle

In Windows you can use this file: C:\Users\username\.gradle\gradle.properties ...

Android plugin 1.3 error

android,android-studio,android-gradle,android-sdk-tools

android gradle plugin 1.3 is not released yet. Currently it's in beta. So, try setting the version to 1.3.0-beta1. You can see the list of all the android grade plugin versions here. Pro tip: scroll all the way down to the bottom so it's easier to see the latest version....

Android studio 1.1.0 setting minifyEnabled true causing issues with app

android,android-studio,android-gradle,proguard,retrofit

Proguard doesn't play well with many of the libraries I used in my project. For gson I added the proguard rules given by the gson team at http://google-gson.googlecode.com/svn/trunk/examples/android-proguard-example/proguard.cfg You need to change -keep class com.google.gson.examples.android.model.** { *; } to -keep class com.your.package.name.your.models.** { *; } For retrofit you need to...

android.applicationVariants.size() always returns 0

gradle,android-gradle

This is normal behavior. Notice this sentence in the changelog (v 0.5.5): access to the variants container don't force creating the task. This means android.[application|Library|Test]Variants will be empty during the evaluation phase. To use it, use .all instead of .each ...

Aidl is missing error

android,android-gradle,build.gradle

I just ran into this earlier this week. Change: classpath "com.android.tools.build:gradle:1.3.0-beta1" to: classpath "com.android.tools.build:gradle:1.3.0-beta2" to line up with the rc2 build tools....

enable dexoptions based on buildtype android gradle

android,android-gradle

I believe I found a solution. Builds seem faster but I don't see any log messages to indicate incremental dex is working. applicationVariants.all { variant -> if (variant.buildType.name == 'debug'){ variant.dex.enableIncremental = true variant.dex.dexOptions.incremental = true variant.dex.dexOptions.preDexLibraries = true } } ...

Android Studio broke down Error:error: package xxx does not exist, error: cannot find symbol class

android,git,android-studio,android-gradle,android-sdk-tools

Clone the project again and build the project if possible

Can Powermockito be used with Android Studio 1.2

android,android-studio,mockito,android-gradle,powermock

It should be good already. At least in my case its working fine. dependencies { testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:2.0.5-beta' testCompile 'com.android.support:support-v4:22.0.0' testCompile ('org.powermock:powermock-api-mockito:1.6.2') { exclude module: 'hamcrest-core' exclude module: 'objenesis' } testCompile ('org.powermock:powermock-module-junit4:1.6.2') { exclude module: 'hamcrest-core' exclude module: 'objenesis' } } Also, remember to select Unit Tests in the...

:app:dexDebug ExecException finished with non-zero exit value 2

java,android,android-studio,gradle,android-gradle

After days of trying out finally could fix the issue. The problem with one of my .jar files. I had to remove each jar and check one by one until i found it. I removed the .jar file and cleaned my project and ran successfully. If any one should face...

ExecException when adding the new support design library

android,android-gradle

You should consider changing your compile 'com.google.android.gms:play-services:7.5.0' dependency, and grab only a portion of the Play Services. You can see the guide for it at https://developers.google.com/android/guides/setup#split , that will most likely solve your 65k issue as well....

android studio cannot find the file specified

android,android-studio,android-gradle

Try to close project, remove folder classes on path D:\Apps\Application\app\build\intermediates\classes\, reopen project and rebuild. When I had same issue, it helped me.

how to migrate project from android studio to android studio

android,android-studio,android-gradle

Just copy your project folder from inside .../AndroidStudioProjects and paste it in the .../AndroidStudioProjects folder in your target laptop. All the files of the project are contained there....

Android tests build error: Multiple dex files define Landroid/support/test/BuildConfig

java,android,android-gradle,build.gradle,android-espresso

Update (6/04/2015): With the latest release of runner 0.3 and rules 0.3, this answer is no longer needed. You can simply use androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test:rules:0.3' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' with latest support libraries. (22.2.0 as of this writing) Update (5/30/2015): compile 'com.android.support:appcompat-v7:22.2.0' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' //...

Android Support Design gradle error

android,android-gradle,appcompat,android-support-design

As of version AppCompat 22.1.0, you should use AppCompatEditText instead of the internal TintEditText.

java.util.zip.ZipException: duplicate entry

android,android-studio,android-gradle,zxing,android-developer-api

Make sure you have the latest build toolds and sdk from the SDK manager. I have converted those jars to Gradle dependencies. build.gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' } // <-- added...

Changed build.gradle now can't install app delete faild internal error

java,android,gradle,android-gradle,build.gradle

The problem was in the gradle file, the compileSdkVersion was accidentally changed from 21 to 22, so I had to change it back, change the buildToolVersion and the target sdk version to the latest version. the comments were way off, I ended up deleting all my phones cached data as...

AAR class library stored in bintray doesn't link to the extended class

android,android-gradle,build.gradle,aar,bintray

It looks like transitive dependencies aren't working. Try replacing the dependencies in your build.gradle with this dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile(group: 'it.code.martin', name: 'wordutils2', version: '1.0.0', ext: 'aar’){ transitive=true} } If that doesn't work, I'd recommend downloading the correct apache commons Jar and building the library with...

Android gradle Copy from more that one directory into one .jar

java,android,android-studio,android-gradle

For Android: Command: gradlew jarDebug / gradlew jarRelease Code: android.libraryVariants.all { variant -> task("jar${variant.name}", type: Jar) { description "Bundles compiled .class files into a JAR file for $variant.name." dependsOn variant.javaCompile from variant.javaCompile.destinationDir exclude '**/R.class', '**/R$*.class', '**/R.html', '**/R.*.html' } } Source: http://stackoverflow.com/a/19967914/950427 Java or Android Project: task makeJar(type: Copy) { from('directory1/')...

Android Studio: BuildConfig.java not getting generated properly

android,android-gradle

String type build config fields should be declared like this: buildConfigField "String", "SERVER_URL", "\"http://dev.myserver.com\"" the field name in quotes, the field value in mirrored quotes additionally....

java.exe finished with non-zero exit value 2 when using Facebook SDK

java,android,gradle,android-gradle,facebook-android-sdk

First of all you should try to list your dependencies with gradle :MODULE:dependencies Check if there are libraries conflicts ( same library but different version ). In this case i supose you should exclude support library module from Facebook SDK. compile ('com.facebook.android:facebook-android-sdk:3.23.1'){ exclude group: 'com.google.android', module: 'support-v4' } ...

Functions are missing from the Application object, when using multidex and Dagger 2

android,android-gradle,dagger-2,multidex,android-multidex

The new support v4 library has multidex included, have you tried using that? add the following to your gradle dependencies: compile "com.android.support:support-v4:$21.0.+" and add this flag to your android > defaultConfig in gradle android{ defaultConfig{ .... multiDexEnabled true } } ...

Android studio issue with PNG

android-studio,android-gradle,libpng,aapt

Somehow your system is promoting the warnings to errors. Applications can force the sRGB-checking to be skipped by putting the following line in your application and recompiling it png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); as explained in the libpng manual. This checking was added at libpng version 1.6.0 and the option to skip...

Unable to import ActivityChooserModel

android,android-studio,gradle,android-gradle,shareactionprovider

This compiled for me: import android.support.v7.internal.widget.ActivityChooserModel; import android.support.v7.widget.ShareActionProvider; public class MainActivity extends AppCompatActivity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActivityChooserModel dataModel = ActivityChooserModel.get(this, ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME); } build.gradle: dependencies { compile fileTree(dir: 'libs', include: ['*.jar'])...

Why does Gradle disregard release{} and implement a rule on debug build as well?

android-studio,android-gradle

the release{} is being disregarded Not really. Every line of code in build.gradle is executed when the script is processed. Gradle scripts are not there to execute code at build time. They are there to define the object model of the build process. In Android Studio, Gradle scripts are...

AndroidStudio ExternalSystemException with kotlin 0.12.213

android,android-studio,android-gradle,kotlin

This is fixed in Kotlin 0.12.356. You may see the discussion in the corresponding issue: KT-7862.