android-gradle

Android Studio: Gradle Product Flavors: Define custom properties

我与影子孤独终老i 提交于 2019-11-27 13:58:01
I am building different product flavors of an Android App in Gradle (Android Studio). Hence I defined the following product flavors: android { project.ext.set("customer", "") project.ext.set("server", "") //Configuration happens here - code removed for readability buildTypes { debug { server = "test" } release { server = "release" } } //Available product flavors productFlavors { customerA{ customer = "a" } customerB{ customer = "b" } customerC{ customer = "c" } } } However, later on, when I access the defined project property "customer" (whose value is set in the product flavor i am currently

gradle force build tools version on third party libraries?

你说的曾经没有我的故事 提交于 2019-11-27 13:40:50
how can I force a library to use sdk build tools 19.1.0 or above without forking/manually editing the build.gradle file for the library? I keep getting this error when using libraries... Error:The SDK Build Tools revision (.......) is too low for project ':somelibrary'. Minimum required is 19.1.0 The lack easy way to do it is beyond my understanding. Tons of people use library projects that they don't own, have to build with Jenkins or have other reasons not to touch them and don't want to fork them for personal use. Anyway, I found a solution here . Will copy it here just in case: In you root

java.lang.IllegalAccessError: Method 'void android.support.v4.content

北城余情 提交于 2019-11-27 13:37:40
I updated playservice in my sdk and I got this error. And I am not able to access GCM Token. Before update sdk my project work perfectly. I waste my whole day in it but not found any solution. I tried this but gettting error in this dependencies com.google.android.gms:play-services-plus:9.0.0 Here is my logcat Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.hwindiapp.passenger/files/instant-run/dex/slice

Echo off in Jenkins Console Output

你。 提交于 2019-11-27 13:00:58
I'm following guideline how to sign Android apk with Jenkins. I have parametrized Jenkins job with KSTOREPWD and KEYPWD. A part of Jenkins' job configuration (Build->Execute shell) is to take those parameters and store them as environment variables: export KSTOREPWD=${KSTOREPWD} export KEYPWD=${KEYPWD} ... ./gradlew assembleRelease The problem is when the build is over anybody can access the build "Console Output" and see what passwords were entered; part of that output: 08:06:57 + export KSTOREPWD=secretStorePwd 08:06:57 + KSTOREPWD=secretStorePwd 08:06:57 + export KEYPWD=secretPwd 08:06:57 +

Android Studio - Could not find intellij-core.jar

折月煮酒 提交于 2019-11-27 12:33:59
I am using android studio 3.1.4. Error:Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar I was able to fix the issue by changing the order of the repositories here: /platforms/android/CordovaLib/build.gradle from this: repositories { jcenter() maven { url "https://maven.google.com" } } to this: repositories { maven { url "https://maven.google.com" } jcenter() } If you're using classpath 'com.android

Gradle build null console object

拜拜、爱过 提交于 2019-11-27 12:18:09
I'm trying to get my gradle builds to prompt at the console for a password using examples from stack overflow When I have a statment such as: def password = System.console().readLine("Enter keystore password ") When I run I get the error Cannot invoke method readLine() on null object It seems console is coming out as null . What I've read this requires java 6 which if I go to a command prompt and type java -version I'm running Java(TM) SE Runtime Environment (build 1.6.0_27-b07). This issue is being tracked in Gradle's Github repo: Can't use System.console() with the Gradle Daemon . For some

Problem with play-services-measurement-base on ionic

怎甘沉沦 提交于 2019-11-27 11:53:25
I have a problem on an ionic project that it started happening yesterday without modifying any dependency. When I run ionic cordova run android I have this error: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. But I didn't installed any dependency in these days. This is my cordova plugins list: cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin" cordova-plugin-advanced-http 2.0

Error while merging dex Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

◇◆丶佛笑我妖孽 提交于 2019-11-27 11:46:37
Error when merging the dex following are the dependencies. ext { anko_version='0.10.5' support_lib='1.0.0-alpha1' room_lib = "1.1.0" } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "androidx.cardview:cardview:$support_lib" implementation "com.google.android.material:material:$support_lib" implementation "androidx.appcompat:appcompat:$support_lib" implementation "org.jetbrains.anko:anko:$anko_version" implementation "androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1" implementation "android.arch.persistence.room:runtime:$room_lib"

How to use a library project in android studio

99封情书 提交于 2019-11-27 11:29:19
I have been trying to add this library project to my existing project in Android Studio. It's the first time I am going to use a library project and I am having tough time. I have looked around for many ways to do this from tutorials and posts around but couldn't get it done. owe I'm not sure if it's already possible to add a library project via the IDE (-> without any problems). I do this by configuring the gradle files of my project like this: create a folder in your root project directory named libs copy the folder datetimepicker-library to libs add this library in your settings.gradle with

how to build an APK and separate libraries that the app loads dynamically

前提是你 提交于 2019-11-27 11:28:39
The short summary is: How do I build an APK and separate libraries (by which I mean sets of classes (and ideally, resources too) in some form, such as JAR, AAR or DEX files), but not include those libraries in the APK; instead, the app loads them at run time? Detail So my main question is how to build such an app (e.g. Gradle configuration). How do I specify which classes go into which JAR or DEX files? Do I create an Android Studio module for each DEX file I want to end up with? A closely related question is how the Java code should then load the external libraries and access their classes at