build.gradle

Can't add LocalBroadcastManager to project in Android Studio

╄→гoц情女王★ 提交于 2019-12-08 02:07:46
问题 I think I've tried everything now... I've been all over stack overflow, I've even consulted the android doc Most of the posts here show how to add the .jar file in Eclipse "android tools -> add support library" or something So I've tried to do it how the doc tells me, by going to build.gradle, and adding compile 'com.android.support:support-v4:19.0.0' to the dependencies but even if I add it, and rebuild the project, I still can't import android.support.v4.content.LocalBroadcastManager ... it

Could not fetch model of type 'IdeaProject' using Gradle distribution

雨燕双飞 提交于 2019-12-08 01:48:35
问题 I was following this tutorial of embedding an external project in android studio with gradle.. and I got stuck at this error: Gradle 'HelloWorldProject' project refresh failed: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. A problem occurred configuring project ':HelloWorld'. A problem occurred configuring project ':HelloWorld'. Failed to notify project evaluation listener. Configuration with name 'default'

UNEXPECTED TOP-LEVEL EXCEPTION in Android Studio

徘徊边缘 提交于 2019-12-08 00:53:49
问题 In one of my projects i am getting this Exception while building gradle file Error:Execution failed for task ':emBazaarV4:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: F:\AndroidSDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output F:\AndroidStudioWorkspace\EmBazaarV4\emBazaarV4\build\intermediates\dex\debug --input- list=F:\AndroidStudioWorkspace\EmBazaarV4\emBazaarV4\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output:

What is the right way to define versionName as ext variable in Android build.gradle?

流过昼夜 提交于 2019-12-07 17:53:57
问题 I tried to define versionName as an ext variable to be used in my gradle configuration file app/build.gradle. ext { versionCode = 19 versionName = "1.2.3" ... } ... android { ... defaultConfig { ... versionCode versionCode versionName versionName } ... } ... task updateReleaseMetadata(type:Exec) { commandLine 'sh' args "MyShellScript.sh", versionName } ... It seemed work fine. However my android code failed to retrieve the versionName as following PackageInfo pi = context.getPackageManager()

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable

北城余情 提交于 2019-12-07 17:40:51
问题 Showing this error on running my project, I tried all the solution available but it's not working. The only thing left is to set the ANDROID_DAILY_OVERRIDE environment variable, but I am struggling to do so. How I can set ANDROID_DAILY_OVERRIDE environment variable on a mac? 回答1: Change your build.gradle file to classpath 'com.android.tools.build:gradle:2.0.0-alpha6' Also navigate to to yourProjectPath/Gradle/wrapper and open the gradle-wrapper.properties Change distributionURL with

Android Studio fails - unsupport unsupported major minor version 51.0

妖精的绣舞 提交于 2019-12-07 17:28:10
问题 Until yesterday my Android Studio was working fine and helping me to create Applications. But today, it started giving Gradle error error stating unsupport major minor version 51.0 and asking me to configue gradle. I get the same error if I try to import the project back. My java version is 7 and older Android projects in the Android studio work properly. $ /usr/bin/java -version Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8 java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1

Android Gradle Issue

大城市里の小女人 提交于 2019-12-07 17:07:25
问题 I know there are 100's of questions/answers around this topic, but none of them seem to give me an answer. I know some(if not all) of my problems are around my lack of understanding of gradle in general. BUT, i'm hoping for some help. I've got my project working just fine on my desktop. I'm traveling this week, and wanted to work on it some on my laptop. I have all the files, and have the same version of Android Studio on both machines. I kept getting all kinds of gradle errors when opening

duplicate entry: META-INF/ when build .apk. with gradle plugin 3.0.0. Exclude not applicable here

蹲街弑〆低调 提交于 2019-12-07 16:29:33
问题 Before asking this question I searched for an answer In short: problem appears with the latest version of Gradle plugin for Android Studio version 3.0.0. If I use previous version of Gradle plugin (2.3.3) Studio builds .apk without problem/ Error text: Error:Execution failed for task ':stockManagment:transformClassesWithStackFramesFixerForNextDebug'. com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent

All com.android.support libraries must use the exact same version specification found versions 25.2.0, 25.0.0

两盒软妹~` 提交于 2019-12-07 15:44:37
问题 After my android studio today from version 2.2.3 to 2.3 then i got this error in build.gradle on the 'com.android.support:appcompat-v7:25.2.0' dependencies. But the project still can be run. and i run a Gradle dependency report to see what my full tree of dependencies. Display as below. But i still do not know how to fix this error. Dependency Tree ------------------------------------------------------------ Project :app ------------------------------------------------------------ compile -

Android: Unable to build APK. More than one file was found with OS independent path 'META-INF/android.arch.lifecycle_runtime.version'

我怕爱的太早我们不能终老 提交于 2019-12-07 15:29:06
问题 All of a sudden, I am getting this error while building APK Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDevDebug'. > More than one file was found with OS independent path 'META-INF/android.arch.lifecycle_runtime.version' I went through a lot of StackOverflow post related to META-INF issue such as exclude 'META-INF/***' (LICENSE, NOTICE etc etc) in packagingOptions but it's not working. I have uninstalled Java 9 also and installed JDK8. Here is the output when I