Tag: android-gradle

what is generated and intermediates folders in build directory and why outputs folder is missing

I’m building application with Android Studio and Gradle. When the build is finished the build folder contains the following folders: – assets – CordovaLib – build – src – build.gradle – gradle – src – com.my.package – CordovaApp – build.gradle – build – generated – intermediates – outputs //not displayed in android studio’s project tree […]

How to include multiple Repositories in build.gradle?

Android Studio won’t let me build this. It says com.mixpanel.blahblahblah is not found. com.mixpanel.blahblahblah comes from mavenCentral() I know the problem is because it doesn’t recognize mavenCentral() because it only recognizes the other repo. How can I include both and get this project working? apply plugin: ‘com.android.application’ apply plugin: ‘crashlytics’ buildscript { repositories { maven […]

Android gradle test framework: single class

Is it possible to run a single test class using the new Android gradle build framework? I have a test package that has multiple test classes (All of them are InstrumentationTestCase classes). I’ve been able to setup my build.gradle file to run the test package defaultConfig{ testPackageName “com.company.product.tests” testInstrumentationRunner “android.test.InstrumentationTestRunner” } But is there a […]

Limit of methods 64K per a dex file in Android

I faced with this problem java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536 and I decided to exclude some methods from a dex file. My gradle.build: compile (‘com.google.android.gms:play-services:+’) { exclude group: “com.google.android.gms.analytics” exclude group: “com.google.android.gms.games” exclude group: “com.google.android.gms.plus” exclude group: “com.google.android.gms.drive” exclude group: “com.google.android.gms.ads” } I think that this snippet of code is wrong, because […]

app-debug-unaligned.apk specified for property 'inputFile' does not exist

This morning when I opened my Android Studio project, that I have been working on for a week or so, it was suddenly unable to run the app on my phone. It can sync with gradle without any errors, but when i try to run the application i get the following error: A problem was […]

How to use findViewById() in robolectric

I simply want to test with robolectric if a certain view is visible in a fragment. My unit test looks like this: ActivityController controller = Robolectric.buildActivity(FragmentActivity.class); FragmentActivity activity = (FragmentActivity) controller.create().start().resume().visible().get(); F fragment = new MyFragment(); activity.getSupportFragmentManager().beginTransaction() .add(fragment, FRAGMENT_TAG).commit(); View view = fragment.getView().findViewById(R.id.my_view); assertEquals(view.getVisibility(), View.VISIBLE); I’m using the latest android gradle plugin 1.1.3, robolectirc 2.4 […]

Android Studio 2.3 Update not opening app

I recently updated the Android Studio to 2.3. When I hit the instant run button, It compiles the app but doesn’t open the app on the Android device. Even ‘Hot Swap’ is not enabled after that, it shows “No active ‘app’ launch”. Any idea what I might be doing wrong. I tried creating a new […]

Using a different manifestPlaceholder for each Build Variant

I will start by saying that I am very new to Gradle, so I apologize if this has already been answered. I’m working on an Android application that uses an API key to access a 3rd party tool. A different API key needs to be used depending on both the flavor and build type of […]

App is compiled every time Gradle runs, taking significant time

When developing with Eclipse, if I’ve ran/debugged an app before and have not changed its source code, it’s reasonably fast to run/debug the same app again. However, with Android Studio and Gralde, every time when I try to run/debug an app, gradle build would always run, adding an additional 15~45 seconds of delay to the […]

Play Service granular dependency error

I try to use new Granular Dependency for Google Play Service 6.5.+ In my gradle I set: dependencies { compile ‘com.android.support:appcompat-v7:21.0.2’ compile ‘com.google.maps.android:android-maps-utils:0.3’ compile ‘com.google.android.gms:play-services-base:6.5.87’ compile ‘com.google.android.gms:play-services-location:6.5.87’ compile ‘com.google.android.gms:play-services-maps:6.5.87’ } but I get back this error: Error:Execution failed for task ‘:app:processDebugResources’. Error: more than one library with package name ‘com.google.android.gms’ You can temporarily disable this […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.