android-gradle-plugin

Setting targetSdkVersion and compileSdkVersion for bazel, android tensorflow

99封情书 提交于 2021-02-16 21:06:54
问题 I need help in how to set the target and compile Sdk versions separately for bazel. I want to run tensorflow on the phone following this tutorial. After editing WORKSPACE for bazel as follows: android_sdk_repository( name = "androidsdk", api_level = 24, build_tools_version = "24.0.1", path = "/home/Android/Sdk", ) android_ndk_repository( name="androidndk", path="/home/Android/Sdk/ndk-bundle", api_level=21) I get PARSE ERROR on the phone upon apk installing: adb install -r bazel-bin/tensorflow

Setting targetSdkVersion and compileSdkVersion for bazel, android tensorflow

泄露秘密 提交于 2021-02-16 21:04:38
问题 I need help in how to set the target and compile Sdk versions separately for bazel. I want to run tensorflow on the phone following this tutorial. After editing WORKSPACE for bazel as follows: android_sdk_repository( name = "androidsdk", api_level = 24, build_tools_version = "24.0.1", path = "/home/Android/Sdk", ) android_ndk_repository( name="androidndk", path="/home/Android/Sdk/ndk-bundle", api_level=21) I get PARSE ERROR on the phone upon apk installing: adb install -r bazel-bin/tensorflow

How To change Android App Bundles name (app.aab) to reflect App version and build type

眉间皱痕 提交于 2021-02-16 16:43:28
问题 While I'm building an APK I can change APK name in build.gradle script, like that: android.applicationVariants.all { variant -> if (variant.buildType.name != "debug") { variant.outputs.all { outputFileName = "${variant.applicationId}-v${variant.versionName}-${variant.name}.apk" } } } An I'll have something like this com.myapp.package-v1.x.x-release Is there a way to do something similar with Android App Bundles, it is not convenient to always have app.aab 回答1: I have come up with the solution

How to use productFlavors for android aab bundles

杀马特。学长 韩版系。学妹 提交于 2021-02-16 13:08:23
问题 I try to build different Android app bundles via productFlavors. To keep and test the files I need a fixed file name. For APK's I have the following working code: applicationVariants.all { variant -> if (variant.buildType.name.equals("release")) { variant.outputs.all { output -> outputFileName = "${applicationId}-${versionCode}-${variant.flavorName}.apk" } } if (variant.getBuildType().isMinifyEnabled()) { variant.assemble.doLast { copy { from variant.mappingFile into variant.outputs[0]

Cannot change strategy of configuration ':testCompile' after it has been resolved

若如初见. 提交于 2021-02-11 15:43:58
问题 when I upgraded my google-services version to 4.1.0 and gms:play-services-maps:16.0.0 getting below error during building the project. A problem occurred evaluating root project ':app'. > Failed to apply plugin [id 'com.google.gms.google-services'] > Cannot change strategy of configuration ':testCompile' after it has been resolved. Below is my build.gradle buildscript { repositories { flatDir { dirs './lib' } google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1'

What is the difference between Sync project with gradle files and Sync with File System?

醉酒当歌 提交于 2021-02-11 14:15:04
问题 I have been through various answers with respect to the Sync project with Gradle files . But I couldn't find the major difference between Gradle Files and File System . For making/building a project, we need to sync the project with Gradle files. But does it need to be done when are we using the Sync using File system ? 回答1: sync project with gradle files updates the Android Studio project model to match the contents of the Gradle build file. There is no corresponding gradlew command because

Android gradle error version (3.3.1) problem

ぃ、小莉子 提交于 2021-02-11 13:33:00
问题 I have old project and I upgrade gradle. Gradle latest version 3.3.1. Please help me. How to fix this error? com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/username/.gradle/caches/transforms-1/files-1.1/support-fragment-28.0.0.aar/68845f02634c30733176d6df0bd9a4c9/jars/classes.jar com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. com.android.tools.r8.CompilationFailedException: Compilation failed to complete com.android.tools.r8.utils

“Could not resolve all files for configuration ':classpath'.” error in android studio

前提是你 提交于 2021-02-11 12:57:25
问题 error I am getting this error just today. Android studio is saying com.google.jimfs:jimfs:1.1. can't be downloaded. Here is my gradle // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() maven { url 'https://maven.google.com' } } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' } } allprojects { repositories { google() maven { url 'https://maven.google.com' } } } ext { compileSdkVersion = 22

Compile jar with test classes

丶灬走出姿态 提交于 2021-02-11 10:08:17
问题 How can I compile jar with test classes in android? I am using android gradle plugin 1.3.1: classpath 'com.android.tools.build:gradle:1.3.1' I've tried: task testSourcesJar(type: Jar) { from android.sourceSets.test.java.srcDirs } And it creates exactly what is defined: a jar with test sources, not with compiled classes. Where are the compiled classess and on which task I should depend on to create jar with test classes? I need it to prepare test artifact for another project, which must extend

Compile jar with test classes

孤街醉人 提交于 2021-02-11 10:06:20
问题 How can I compile jar with test classes in android? I am using android gradle plugin 1.3.1: classpath 'com.android.tools.build:gradle:1.3.1' I've tried: task testSourcesJar(type: Jar) { from android.sourceSets.test.java.srcDirs } And it creates exactly what is defined: a jar with test sources, not with compiled classes. Where are the compiled classess and on which task I should depend on to create jar with test classes? I need it to prepare test artifact for another project, which must extend