android-gradle

How to set my gradle for final release apk

我是研究僧i 提交于 2019-11-30 07:06:53
Earlier my gradle was like this: WHICH IS OFCOURSE INCORRECT apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion '19.0.3' defaultConfig { minSdkVersion 11 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:gridlayout-v7:19.0.1' compile 'com.android.support:appcompat-v7:+' compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:support-v4:+' compile 'com.google.android.gms:play

Android Studio: execution failed for task : app:compileDebugAidl FAILED

拥有回忆 提交于 2019-11-30 06:47:14
I installed Android Studio 1.2.1.1, with Gradle version 2.2.1, and Android plugin version 1.2.3. I tried to create a simple hello world project, and it give me a build failure of :app:compileDebugAidl FAILED. Am i missing something or have some incompatible issue with version, as this should be a simple application. Thanks for any help. This is the compilation errors I am getting: Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72220Library UP-TO

Running gradle's connectedAndroidTest on a specific device

无人久伴 提交于 2019-11-30 06:41:10
How do you run connectedAndroidTest on a particular device? I would expect something like: ./gradlew connectedAndroidTest -DconnectedAndroidTest.device=XXXX We have a number of devices plugged into our CI server and I can't seem to find any documentation on how to target a specific connected device. connectedAndroidTest runs the tests on ALL connected devices currently. Thanks. Use the ANDROID_SERIAL variable You can do this two ways: 1. Set environment variable # Set once; all following gradlew commands will use this export ANDROID_SERIAL=1000AB0123456YZ ./gradlew <...> 2. "Set" for just a

failed to find style 'cardView Style' in current theme

丶灬走出姿态 提交于 2019-11-30 05:34:53
After updating support library version 27.1.0 Android Studio unable to render CardView. It shows error message as failed to find style 'cardView Style' in current theme But no error in compiling and no difference while seeing on the phone. I have reverted the support library version to 27.0.2 and it's rendering fine. The issue with support library or Android studio ? How to fix this? App Level Gradle: apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'realm-android' apply plugin: 'kotlin-kapt' android {

Code Path per Flavor in Android Gradle

六眼飞鱼酱① 提交于 2019-11-30 05:02:17
I have 2 buildTypes (debug, release) and 2 productFlavors (product1, product2). I want to define a buildConfigField for each buildType and productFlavors. The buildConfigField is the url the app to download data from the server, and it changes for each productFlavor and buildTypes. Now, I have: buildTypes { debug { debuggable true } release { debuggable false } } productFlavors { product1 { buildConfigField STRING, "URL_BASE", '"https://api1.release.com"' } product2 { buildConfigField STRING, "URL_BASE", '"https://api2.release.com"' } } But I want something like this: buildTypes { debug {

Android Gradle Running Tests on Non-Debug Builds

岁酱吖の 提交于 2019-11-30 04:57:06
I have a project with three different build types: debug, beta, and release. My test package is always created for debug builds, but QA uses the beta build and we want QA to run these tests on their vast array of devices. I'm trying to create a testing apk for QA that is signed by the same key as the beta build. Looking through the Android-Gradle documentation, I don't see anything telling me that I can't do this, but I don't see anyway to configure this. Is there anyway I can configure which keystore is used when assembling a test apk? Or is there a way to create an unsigned test apk? Scott

Missing project.gradle in Android View

為{幸葍}努か 提交于 2019-11-30 04:56:34
In Android Studio, project.gradle file is not show when in Android View, but is when in Project view Android View Project View How can I fix this ?? From the Gradle Tool Window in Android Studio (View > Tool Window > Gradle) , Right click on the the project's Gradle config with (root) next to its name. Click on Ignore Gradle project , and right click again then click on Unignore Gradle project . The trigger to this 'buggy' phenomenon actually lies outside your project folder. Assuming a project name of 'SilverBirch', try this: (a) Close the project in Android Studio 3.0.1. (b) Rename your

Create Android library AAR including javadoc and sources

守給你的承諾、 提交于 2019-11-30 04:25:20
My team is developing an Android library, to be used in some example applications, also developed by us. The library is created as an AAR file. Here is its build.gradle apply plugin: 'com.android.library' apply from: 'deploy.gradle' android { compileSdkVersion 20 buildToolsVersion '20.0.0' packagingOptions { exclude 'LICENSE.txt' exclude 'LICENSE' exclude 'NOTICE' } defaultConfig { // Excluded for brevity } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { abortOnError false // if true, check all issues

Set a global variable in gradle that can use in manifest file

徘徊边缘 提交于 2019-11-30 03:56:06
I want to create a global variable similar with applicationId. It is set value in build.gradle and will be used in manifest. Is it possible? You can set them, for instance I'm setting it for different product flavors productFlavors { production { applicationId = "com.myapp.app" resValue "string", "authority", "com.facebook.app.FacebookContentProvider5435651423234" } development { applicationId = "com.myapp.development" resValue "string", "authority", "com.facebook.app.FacebookContentProvider2134564533421" } qa { applicationId = "com.myapp.qa" resValue "string", "authority", "com.facebook.app

How to use tools:overrideLibrary with multiple libraries

自闭症网瘾萝莉.ら 提交于 2019-11-30 03:13:43
I would like to create an Android project that is compatible to e.g. API level 4 but would still like to test it with UiAutomator that requires API level 18 on newer devices. So the app would also run on old devices but the automatic tests would be performed on new devices. Therefore I have created a new project with Android Studio and added the UiAutomator test libraries: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.0.1' androidTestCompile 'com.android.support:support-annotations:23.0.1'