build.gradle

Error on installing apk - parsing the package

寵の児 提交于 2019-11-29 02:13:28
I am working on an android app and everything works fine when I build it in my local system and run on emulator, but as soon as I make and release and install apk on my phone, it crashes with error - There was an error parsing the package As you can see, I am building with latest SDK and build tools, and my phone is running the same version on API too. I have Untrusted Sources installation allowed too. I am taking help of "Build a release version" section on this link. It is generating a file like - app-release-unsigned.apk in my app/build/outputs/apk folder. Please help with it. Emulator AVD

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

纵然是瞬间 提交于 2019-11-29 01:30:18
问题 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? 回答1: 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

Android resource compilation failed in v3.2

China☆狼群 提交于 2019-11-29 01:21:22
So I updated my Android Studio to v3.2. When I tried compiling the project, build fails. Below is the error: Android resource compilation failed Output: C:\Users\Ashish\AndroidStudioProjects\StartUp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:900: error: <item> inner element must either be a resource reference or empty. Command: C:\Users\Ashish\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\7f1fbe9171e916e5044000cd76b749c8\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \ -o \ C:\Users\Ashish\AndroidStudioProjects\StartUp

Could not find property 'processManifest' on com.android.build.gradle.internal.api.ApplicationVariantImpl

折月煮酒 提交于 2019-11-29 01:17:34
I am currently trying to update Android Studio to 1.0.0-RC. This seems to require gradle Android plugin 1.0.0-rc1. After the update, I started having the following error: `Could not find property 'processManifest' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@b9da89c.` With some digging, it seems that processManifest is one of the deprecated properties that were removed in 0.14.3 version . Any idea what the new property name is? The same user guide has not been updated for the new version, so I can't find any documentation for it. EDIT: Here is the code that needs

Failed to resolve: play-services-flags

核能气质少年 提交于 2019-11-29 01:13:36
Today, Android Studio stopped to sync properly due to configuration issues. Could not resolve all files for configuration ‘:app:providerRepositoryDebugCompileClasspath’. Could not find firebase-analytics-impl.aar (com.google.firebase:firebase-analytics-impl:15.0.2). Searched in the following locations: https://jcenter.bintray.com/com/google/firebase/firebase-analytics-impl/15.0.2/firebase-analytics-impl-15.0.2.aar Could not find play-services-flags.aar (com.google.android.gms:play-services-flags:15.0.1). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms

uses-sdk element cannot have a “tools:node” attribute

两盒软妹~` 提交于 2019-11-29 00:46:31
问题 I've updated Android Studio last night to 0.9.0, buildToolsVersion to 21.1.0 and gradle to 0.14.0, after that I'm receiving this error Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk element cannot have a "tools:node" attribute I've spent the last night looking for a solution, I found this: <uses-sdk tools:node="replace" /> But unfortunately, added one more error! Error:(10, 5) uses-sdk element cannot have a "tools:node" attribute Error:(10, 5)

Error:(1, 0) Gradle DSL method not found: 'android()'

馋奶兔 提交于 2019-11-29 00:18:54
问题 What should i do to fix this issue? I am getting this error when i ever i run my project in android studio0.9.1 android {compileSdkVersion 17 buildToolsVersion "19.1.0" defaultConfig { applicationId "com.example.nearby" minSdkVersion 11 targetSdkVersion 19 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }}dependencies { compile 'com.android.support:support-v4:19.0.0' compile 'com.google.android.gms:play-services

Gradle task to create a zip archive of a directory

不打扰是莪最后的温柔 提交于 2019-11-29 00:10:18
问题 I have a gradle task to create a zip archive of a directory. The gradle task is: task archiveReports(type: Zip) { from '/projects/Reports/*' archiveName 'Reports.zip' } When I am running the command 'gradle archiveReports', its showing the build is successful. However, no zip file is getting created. Am I missing something here? 回答1: I figured out a way for this: Its working for me now. task myZip(type: Zip) { from 'Reports/' include '*' include '*/*' //to include contents of a folder present

Android studio broke up my build.gradle file after add a Fragment

泪湿孤枕 提交于 2019-11-28 23:10:29
Using Android Studio 2.0 over El Capitan like the next screenshot said: I found a bug that I can't report: After add a Fragment to my project, AS screw up my module build.gradle file. I mean, before add the fragment they file looks like this screenshot: but after add the Fragment AS screw it in this way: The way to reproduce it is like I'm showing in next screenshot: I can fix it manually, but its so annoying doing it every single time that I add a Fragment. Is there anyway to fix it? I'm on Mac OX with El Capitan. afj88 It is a still open bug, you can monitor it's state here The bug is due to

Using APK Splits for Release but not Debug build type

我怕爱的太早我们不能终老 提交于 2019-11-28 22:21:49
问题 I've successfully implemented APK Splits so that separate APKs are generated for different ABIs. However, for efficiency (and since I have no need for non-armeabi-v7a APKs in Debug), I would like to limit Debug builds to only generate armeabi-v7a APKs. How can this be done? One idea is with this: abi { enable true reset() include 'x86', 'armeabi-v7a', 'mips' universalApk false } Maybe there is some way to set enable based on the Build type? 回答1: You can try a variation on @Geralt_Encore's