build.gradle

Kotlin files not able to use R.java

假装没事ソ 提交于 2019-12-10 14:19:40
问题 I created a new layout file in the appropriate resource folder. After syncing, when I try to reference the layout file, i.e. R.layout.activity_test, R is an "unresolved symbol". When I try to build in AS it fails. The interesting thing is that if I manually import the R file and use it in code, when I try to build on command line, it works. The other thing is when I try to access the layout file using R in a Java file, that also works. So I know R.java is being generated. I tried creating a

Build Failed: Program type already present: com.facebook.ads.Ad

浪子不回头ぞ 提交于 2019-12-10 13:56:53
问题 I try to build a module in Android Studio. It seemed to run on device but when I tried to build an APK, I got an error: Program type already present: com.facebook.ads.Ad Here's the complete log: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':NewApp:transformClassesWithMultidexlistForDevDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution

How to use if else condition in Gradle

为君一笑 提交于 2019-12-10 13:52:10
问题 Can someone tell me how could I write the if else condition in the gradle script I mean i have two different types of zip files one is LiceseGenerator-4.0.0.58 and other one is CLI-4.0.0.60.My deployment script is working fine but I am using the shell script to do this and I want everything in gradle instead of doing it in the shell script.I want when I am deploying the LicenseGenerator it should deploy in differnet way and if it is CLI then it should deploy in other way.Currently deployall

Gradle build task installRelease missing in Android project

眉间皱痕 提交于 2019-12-10 13:44:09
问题 Gradle seems to have lost a build type in a project I am working on. I can recreate a minimal problem as follows. I have the following files: build.gradle local.properties src/main/AndroidManifest.xml build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:+' } } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 1 targetSdkVersion 23 } buildTypes { debug { }

Gradle Build Error : aidl.exe finished with non-zero exit value 1

无人久伴 提交于 2019-12-10 13:27:09
问题 this is my build.gradle file: click to see screenshot and my error : Error:Execution failed for task ':app:compileDebugAidl'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\dev\sdk\build-tools\22.0.1\aidl.exe'' finished with non-zero exit value 1 how can I fix this error? 回答1: Run Gradle with debug enabled (e.g. gradlew build --debug ) to see the actual reason. Common issues include: Package doesn't match manifest Multiple

How to access ext variables in Gradle

别等时光非礼了梦想. 提交于 2019-12-10 13:18:30
问题 I am trying to get the variable defined in a 3rd party library (fabric) to do a condition based on whether Crashlytics is enabled or not. ext.enableCrashlytics = true http://support.crashlytics.com/knowledgebase/articles/202938-gradle The variable can be configured in buildTypes or in flavors but I can't find a way to access it elsewhere in my build.gradle I tried several things without any luck. allprojects.getProperties().get("enableCrashlytics") project.enableCrashlytics project.ext

Cannot acces ActivityCompatApi23 when trying to use FragmentActivity

廉价感情. 提交于 2019-12-10 12:54:12
问题 I'm trying to use a ViewPager on my smartwatch, but I keep getting an error when trying to rebuild/run/debug my application. I'm using a FragmentActivity, which is where the error occurs. I searched stackoverflow and tutorial websites to see what could be the problem, and a lot of results are related to the build.gradle files. However I tried pretty much everything I stumbled upon, but the error didn't change once. The error: Error: Cannot acces ActivityCompatApi23 The error happens on this

Failed to execute aapt

痞子三分冷 提交于 2019-12-10 12:39:18
问题 Please help solving this error: Failed to execute aapt com.android.ide.common.process.ProcessException: Failed to execute aapt at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796) at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551) at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285) at com.android.build.gradle.internal.tasks.IncrementalTask

Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'. > Dependency Error. See console for details

…衆ロ難τιáo~ 提交于 2019-12-10 12:35:59
问题 Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'. Dependency Error. See console for details. After adding the the following dependencies in app.gradle file - androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test:rules:0.5' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' // add this for intent mocking support androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2' // add

Gradle - add directory to classpath

和自甴很熟 提交于 2019-12-10 12:35:28
问题 My application requires that a \config directory be available on the classpath when it looks for configurations files under the directory. I currently have dependencies configured like so, though this is probably not the correct way to make a directory available to my application: dependencies { ... //runtime, compile dependencies pulled from repositories runtime files('config') } I am using the application plugin to create a standalone zip for my project. If my \config directory has \config