Tag: android-studio

How To Stop A Service

How To Stop A Service At A Specific Time Of The Day ? I have been able to start a service at specific time of every day but I want to do the exact same thing to stop but I don’t know how. Here is the code I use to start the service using AlarmManager. […]

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException

I am trying to integrate barcodefraglibv2 into my android app in AndroidStudio. I tried to copy libs core.jar and barcodelib.jar into libs directory. However when I try to run application, I get following error Error:Execution failed for task ‘:Blok:dexDebug’. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/backman/android/sdk/build-tools/android-4.4.2/dx –dex –output /home/backman/AndroidStudioProjects/Blok/Blok/build/dex/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/classes/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/dependency-cache/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/pre-dexed/debug/core-bcdbe5f84dd399255abb34d14ce9def109db2534.jar Error Code: 2 […]

android studio 2.2 how to apply dagger2 without android-apt plugin

my project build.gradle buildscript { repositories { jcenter() } dependencies { classpath ‘com.android.tools.build:gradle:2.2.0-alpha3’ classpath ‘com.google.dagger:dagger-compiler:2.2’ classpath ‘com.google.guava:guava:19.0’ // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } my module build.gradle android […]

Android Studio, Git and three ways merge

On Android Studio, I created a new branch from the master and commited the new branch two times. Then I checkedout the master and commited it one time. So I have two branches with two distinct endpoints and a common parent. Now I am trying a three ways merge: right click on the new branch, […]

How to upgrade appengine-java-sdk installed in .gradle folder

When I build my Android Studio project, it says : ******************************************************** There is a new version of the SDK available. ———– Latest SDK: Release: 1.9.15 Timestamp: Tue Oct 21 21:33:59 EDT 2014 API versions: [1.0] ———– Your SDK: Release: 1.9.14 Timestamp: Thu Oct 16 16:07:33 EDT 2014 API versions: [1.0] ———– Please visit https://developers.google.com/appengine/downloads for […]

Method invocation highlighed error in Android Studio

Im a little bit confused in Android Studio. I didint seen this kind of errors in Eclipse before. Example: FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction tf = fragmentManager.beginTransaction(); Fragment oldFragment = fragmentManager.findFragmentByTag(AddDialogFragment.TAG); this code is working fine, but fragmentManager.beginTransaction(); gets highlighted and says: Method invocation ‘fragmentManager.beginTransaction’ may produce ‘java.lang.NullPointerException’ less… (Ctrl+F1) This inspection reports those conditions […]

Android build will not merge manifests from libraries

We have multiple projects, depending on a many Android lib modules. To avoid duplicated xml tags in the apps manifests, we put the relevant receivers, services and activities in their respective modules. Till today, we used: Android Studio: 2.2.1 gradle: 2.1.3 buildToolsVersion: 23.0.3 Today we’ve updated to: Android Studio: 2.3 gradle: 2.3.0 buildToolsVersion: 25.0.0 Up […]

How does Android Studio gradle plugin manage resource files (AndroidManifest.xml)?

I have my project’s build.gradle located in myApp/app/ directory. AndroidManifest.xml is in myApp/app/src/main directory, at the same level as java/ and res/ directories. When synchronizing the project, I receive notification about missing manifest file. No wonder, actually, when the path is really incorrect. Source file is set as: sourceSets { main { manifest.srcFile ‘src/main/AndroidManifest.xml’ } […]

Android Studio Could not call IncrementalTask.taskAction() on task ':project:dexDebug'

I recently decided to switch from Eclipse to Android Studio. I imported a project I was working on and am now getting this error when I try to run the project. Gradle: Execution failed for task ‘:project:dexDebug’. > Could not call IncrementalTask.taskAction() on task ‘:project:dexDebug’ I’ve been cruising this site for 2 days now and […]

'./gradlew -Dtest.single=SimpleTest test' runs all tests I have

My project is normal Android project created on Android Studio. I googled a lot to run a single test(tests in SimpleTest, 1 test in this case), everyone say that I should do like ./gradlew -Dtest.single=SimpleTest test in my root folder. or I did in my inner project folder ../gradlew -Dtest.single=SimpleTest test I tried so many […]

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