build.gradle

Android gradle two different launcher activities for two different product flavors

橙三吉。 提交于 2019-11-27 16:32:56
问题 This is my case productFlavors { paid { applicationId "com.paid.app" } free { applicationId "com.free.app" } } and in paid flavor I need a different launcher activity in comparison to main or free as done below main/AndroidManifest.xml <activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> paid/AndroidManifest.xml

Error on installing apk - parsing the package

本秂侑毒 提交于 2019-11-27 16:30:09
问题 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

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

拜拜、爱过 提交于 2019-11-27 16:01: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

Android resource compilation failed in v3.2

血红的双手。 提交于 2019-11-27 16:00:50
问题 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

Manifest merger failed : Attribute application@appComponentFactory updating Firebase libraries

倖福魔咒の 提交于 2019-11-27 15:43:14
I am trying to add firebase in my project but when I implement 'com.google.firebase:firebase-messaging:19.0.0' and 'com.google.firebase:firebase-core:17.0.0' . build.gradle (here is the error) apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.user.mikripoli" minSdkVersion 15 targetSdkVersion 28 multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles

Failed to resolve: play-services-flags

邮差的信 提交于 2019-11-27 15:42:57
问题 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

How to exclude res folder from gradle build flavours?

可紊 提交于 2019-11-27 15:05:18
I have a requirement to remove a specific res folder from a flavour. sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] res.srcDirs = ['res'] aidl.srcDirs = ['src'] assets.srcDirs = ['assets'] } } productFlavors { flavor1 { sourceSets { flavor1 { resources { exclude 'res/drawable-mdpi/*' } } } } flavorDimensions "flavor" } But still drawable-mdpi folder is coming to the apk. So could anyone please specify what mistake am I making. Thanks Vivek lxknvlk I finally solved this problem! I have found this link . And did this: add an xml file to res/raw folder. I named

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

喜夏-厌秋 提交于 2019-11-27 14:35:59
问题 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

How to fix google play service error

旧时模样 提交于 2019-11-27 14:34:58
Today after updating the play services in root folder I'm facing the following problem . I'm confused how to fix this. Can anyone please help me to fix this ? This error is irritating a lot. I don't know where's the conflict. By the way why it's showing conflict while no versions are interrelated. Error : The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.0,15.0.0], [15.0.2,15.0.2]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. build.gradle script : apply

Gradle - Could not find or load main class

二次信任 提交于 2019-11-27 14:33:45
I'm trying to run a very simple project using Gradle and running into the following error when using the gradlew run command : could not find or load main class 'hello.HelloWorld' Here is my file structure: SpringTest -src -hello -HelloWorld.java -Greeter.java -build -libs -tmp -gradle -wrapper -build.gradle -gradlew -gradlew.bat I excluded the contents of the libs and tmp folders because I didn't think that would be relevant information for this issue, but I can add it in if need be. Here is my build.gradle file: apply plugin: 'java' apply plugin: 'application' apply plugin: 'eclipse'