build.gradle

Some light on gradle.properties, settings.gradle, gradle-wrapper.properties and local.properties

守給你的承諾、 提交于 2019-12-13 03:35:37
问题 I use them often when configuring my project but mostly add snippers as instructed. I have absolutely no clue which file is for what exactly. Can anyone give a clear picture what each file is for. So far I think local.properties for environment paths like sdk/ndk location settings.gradle for including all modules in project where each module has it's own build.gradle gradle.properties ? gradle-wrapper.properties ? 回答1: gradle.properties Using gradle.properties to create universal variables

Failure to verify dex file Out-of-order annotation_element name_idx

我的未来我决定 提交于 2019-12-13 03:13:53
问题 i need your help. I got a Runtime error when updating my gradle from : implementation 'com.google.android.gms:play-services-auth:15.0.1' implementation 'com.facebook.android:facebook-android-sdk:4.27.0' to : implementation 'com.google.android.gms:play-services-auth:15.0.1' implementation 'com.facebook.android:facebook-android-sdk:4.27.0' implementation 'com.google.android.gms:play-services-ads:15.0.1' implementation 'com.facebook.android:audience-network-sdk:4.27.0' Error Log : E

Can not generate signed apk in android

好久不见. 提交于 2019-12-13 03:12:51
问题 Exception is org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':_4SaleApp:transformClassesWithDexForRelease'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java

Gradle sync fails due to Manifest Merger

霸气de小男生 提交于 2019-12-13 03:00:50
问题 I have been trying to link my app with Firebase, but after adding json file, and adding some codes in gradle , My android project fails at syncing gradle, this is the error I get when syncing gadle ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core

Custom old Android project structure in Gradle

帅比萌擦擦* 提交于 2019-12-13 02:38:16
问题 We have a project structure of the form src src_flavor1 src_flavor2 res res_flavor1 res_flavor2 The core logic and resources are placed in src and res folder resp. The flavoured folders only contains few files which separate the two flavors. Im trying to define this project structure withing the build.gradle file but havnt found any success. Also Im trying to use the prductFlavor tags to create simultaneous builds of the two flavors but no success. Doing all this within the Android Studio

Is it normal that the *.aidl files appeared in the folder of the unzipped apk build within Android Studio

…衆ロ難τιáo~ 提交于 2019-12-13 02:36:51
问题 I used aidl files in my source codes, but compare to the apk build under code base, the one build within Andorid Studio has extra folder that contains .aidl files. Is that normal? Shouldn't these *.aidl files be wrapped in classes.dex?(or resources.arsc?) I also had tried to use packagingOptions { exclude './src/com/mytest/test/*.aidl' } but it doesn't work! following is my build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' }

Adding httpcore and httpmime libraries to Android project gives an error in running the app

孤人 提交于 2019-12-13 01:38:55
问题 In my Android app I'm using httpcore and httpmime libraries. My build.gradle files dependancy section contains below part, compile 'org.apache.httpcomponents:httpcore:4.4.4' compile 'org.apache.httpcomponents:httpmime:4.5.2' and when I'm running the app gives an error. the log is as shown below, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate

Empty folder importing external library

六眼飞鱼酱① 提交于 2019-12-12 21:14:09
问题 I want to import to my android project an external library: CouchBase lite I have cloned the library using Git $ git clone git://github.com/couchbase/couchbase-lite-android.git as well the submodules git submodule update --init --recursive In order to import the library to my Android project I am doing: file->New->Import Module This screen is showing: After click on finish, the project has been imported but the folder couchbase-lite-android appears empty as can see: That is not correct as you

Get compiled .class output directory in Android Gradle task

半世苍凉 提交于 2019-12-12 20:09:11
问题 I'm creating a Gradle task for my Android project that needs to know the path to the compiled .class files. How can I get this path? I've found suggestions (here and here; also see the Gradle docs for SourceSet) that sourceSets.main.output.classDir will give me this path, but when I try to use it, I get the error Could not find property 'output' on source set main . This happens even when I create a new, minimal project, with the following build.gradle : buildscript { repositories {

How to publish and use gradle plugin with dependencies on local project?

不问归期 提交于 2019-12-12 19:58:43
问题 I am creating gradle plugin which has dependency on my other local module. Some of its gradle build look like this: dependencies { compile gradleApi() compile project(":myDependencyProject") } publishing { publications { maven(MavenPublication) { groupId = 'org.my.gradle.plugin' artifactId = 'some-name' version = '1.0-SNAPSHOT' from components.java } } } gradlePlugin { plugins { jsonPlugin { id = 'org.my.gradle.plugin' implementationClass = 'my.implementation.class' } } } When I publish my