Tag: android-gradle

Android Studio build flavors – How to have same source files in diverse flavors

I need to create a demo flavor in android studio for an app. In my app level gradle file i have created another flavor called demo and the default flavor of full of course. It looks like this: apply plugin: ‘com.android.application’ android { compileSdkVersion 22 buildToolsVersion “21.1.2” defaultConfig { applicationId “com.example.uen229.myapplication” minSdkVersion 17 targetSdkVersion 22 […]

Generating .so files in Android Studio 1.0.2 with NDK

I have been working on getting a very simple NDKSample application built as per the walk-through here. My problem is, I cannot get Android Studio to generate the .so files, so I have no libraries. I understand that NDK Support is deprecated now and there will be an alternative provided early this year, however there […]

Configure test folder for unit testing in Android studio

I have added a folder for unit testing in my android studio project. The default folder is andoidTest but I have added a new folder and name in test instead. (like robolectric sample tests) When I add test Dependency in my build.gradle under module such as testCompile(“junit:junit:${junitVersion}”) testCompile (“org.robolectric:robolectric:${robolectricVersion}”) They do not get added to […]

Android Studio : Unable to delete original file

I’m very new to android and I just recently cloned an Android project. When Android Studios performs the indexing once opening the project, i get this error all the time. this is the error I get from Android Studio. Error:(89, 0) Failed to delete original file ‘C:\Users\myname\AppData\Local\Temp\gradle_download8065263342645015068bin’ after copy to ‘C:\Users\myname\.gradle\caches\modules-2\files-2.1\com.android.tools.build\gradle\1.5.0\1c3d2b23212349ffbe6479fcb04732c5cddaf98b\gradle-1.5.0.pom’ <a href=”openFile:D:\myname\mobile-myapp-tester\platforms\android\build.gradle”>Open File</a>

Unity project as dependency in Gradle

I am trying to import an unity3d project to my android project as a module. All is okay, gradle sync finish without error, but when i add unity project as dependency to my project and run gradle sync then it says: Error:Dependency myapplication:unityproject:unspecified on project app resolves to an APK archive which is not supported […]

How can I add a JAR in my gradle project?

I am using gradle in Android studio for an android project. I have a jar that I downloaded called TestFlightAppLib.jar. This jar isn’t present in the maven repository so I can’t just put it in my build.gradle. How can I add this JAR file to my project? I don’t see any option to add an […]

Instant run won't work on Android Studio, says Gradle Version 2.10 is required. I use 2.10

This is the error I get: Error:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/alinrosu/Workspace/passenger-android/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip I use this inside my buildscript: dependencies { classpath ‘com.android.tools.build:gradle:2.0.0-alpha5’ } This is my gradle-wrapper.properties file: #Tue Jan 05 13:28:23 CET 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip […]

could not find gradle 3.0.0-alpha4

a few days ago i have installed android studio 3.0 (preview) and after that in stable version (studio 2.3.3) when i try to import project it give me an error. In preview everything works fine. this is an error: Error:Could not find com.android.tools.build:gradle:3.0.0-alpha4. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.jar https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom […]

Android Multiple dex files define Lcom/google/android/gms/common/api/zza

Building project and deploying app to the emulator with API level 22 or 25 goes ok, but when i try to build APK or deploy app to my real device with API level 16 i get the following error: Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza; My […]

Why does my App start incredibly slow (10s+) at first run, showing only white screen on android 5.0?

I have a freshly created app (built in android studio 2.0), having a few activities. When I test it on my Android 4.3 (note 2) device it starts nicely and fast after a clean install, in turn the same app on my samsung galaxy S4 with android 5.0, hangs for about 10-15 seconds while showing […]

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