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

Update (9/07/2015): You can continue to work with 22.2.1 if you use the following excludes: androidTestCompile (‘com.android.support.test.espresso:espresso-core:2.2’) { exclude group: ‘com.android.support’, module: ‘support-annotations’ } androidTestCompile (‘com.android.support.test:runner:0.3’) { exclude group: ‘com.android.support’, module: ‘support-annotations’ } androidTestCompile (‘com.android.support.test:rules:0.3’) { exclude group: ‘com.android.support’, module: ‘support-annotations’ } If you depend on espresso-contrib, you need the exclude as well. Update (8/03/2015): … Read more

How to add ojdbc7 to Java web app by Gradle?

Gradle currently can’t handle the redirects needed by the realm-based SSO mechanism used by Oracle’s maven repo. A workaround is to use this URL instead url “https://www.oracle.com/content/secure/maven/content” In addition, you need to supply credentials for authentication. Here’s a minimal example: plugins { id ‘java’ } repositories { jcenter() maven { url “https://www.oracle.com/content/secure/maven/content” credentials { username=”<Oracle … Read more

Build variants in Gradle for a Library Project in Android

It’s a @bifmadei answer from google code issue and it helps for me: Obsolete 1: Try setting this in the dependency project android { publishNonDefault true … } Obsolete 2: Starting from gradle 4.10.1 publishNonDefault is true by default. So just use the recommendation below: Include this in the project that uses it dependencies { … Read more

Program type already present: android.support.v4.app.BackStackRecord

Program type already present: android.support.v4.app.BackStackRecord$Op Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)} The problem is happened because of duplicated support library. This dependency: implementation ‘com.github.ViksaaSkool:AwesomeSplash:v1.0.0’ is using old version of support library. Try excluding the support library if you already have it with: // support libraries we want to use implementation … Read more

Setting up Gradle for api 26 (Android)

Have you added the google maven endpoint? Important: The support libraries are now available through Google’s Maven repository. You do not need to download the support repository from the SDK Manager. For more information, see Support Library Setup. Add the endpoint to your build.gradle file: allprojects { repositories { jcenter() maven { url ‘https://maven.google.com’ } … Read more