How to use opencv in using Gradle?

You can do this very easily in Android Studio. Follow the below steps to add Open CV in your project as library. Create a libraries folder underneath your project main directory. For example, if your project is OpenCVExamples, you would create a OpenCVExamples/libraries folder. Go to the location where you have SDK “\OpenCV-2.4.8-android-sdk\sdk” here you … Read more

Android- Error:Execution failed for task ‘:app:transformClassesWithDexForRelease’

i fixed it just this code. local.properties org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m and you should do this changing on gradle defaultConfig { applicationId “yourProjectPackage” minSdkVersion 15 versionCode 1 versionName “1.0” targetSdkVersion 23 multiDexEnabled true //important }

Manifest merger failed : uses-sdk:minSdkVersion 14

Note: This has been updated to reflect the release of API 21, Lollipop. Be sure to download the latest SDK. In one of my modules I had the following in build.gradle: dependencies { compile ‘com.android.support:support-v4:+’ } Changing this to dependencies { // do not use dynamic updating. compile ‘com.android.support:support-v4:21.0.0’ } fixed the issue. Make sure … Read more

Is it possible to declare a variable in Gradle usable in Java?

Here are two ways to pass value from Gradle to use in Java; Generate Java Constants android { buildTypes { debug { buildConfigField “int”, “FOO”, “42” buildConfigField “String”, “FOO_STRING”, “\”foo\”” buildConfigField “boolean”, “LOG”, “true” } release { buildConfigField “int”, “FOO”, “52” buildConfigField “String”, “FOO_STRING”, “\”bar\”” buildConfigField “boolean”, “LOG”, “false” } } } You can access … Read more

“No cached version… available for offline mode.”

Had the same error after updating Android Studio today. For me, it wasn’t a matter of proxy settings: Uncheck “Offline work” in Android Studio 0.6.0: File->Settings->Gradle->Global Gradle Settings or in OSX: Preferences->Gradle->Global Gradle Setting or in more recent versions: File->Settings->Build, Execution, Deployment->Build tools->Gradle Resync the project, for example by restarting the Android Studio Once synced, … Read more

finished with non zero exit value

I was getting this exact same error. I ran the command ./gradlew assembleDebug –info Where “assembleDebug” was replaced with the assemble task for a debug version of the flavor I wanted. Look for output Successfully started process ‘command ‘/usr/local/opt/android-sdk/build-tools/21.1.2/aapt” Right below that was an error describing a resource which I used in a layout file … Read more

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’

Just correct Google play services dependencies: You are including all play services in your project. Only add those you want. For example , if you are using only maps and g+ signin, than change compile ‘com.google.android.gms:play-services:8.1.0’ to compile ‘com.google.android.gms:play-services-maps:8.1.0’ compile ‘com.google.android.gms:play-services-plus:8.1.0’ From the doc : In versions of Google Play services prior to 6.5, you … Read more

Android Material and appcompat Manifest merger failed

I had similar problem. Added two lines in gradle.properties file: android.useAndroidX=true android.enableJetifier=true These two lines automatically resolved my dependency conflicts between google’s files and third party dependencies. Here’s the link to follow: https://developer.android.com/topic/libraries/support-library/androidx-overview#new-project