android-gradle

How do I add Guava to my Android Studio project?

一世执手 提交于 2019-11-28 21:20:15
First and foremost, I am aware of the existence of this question - How do I add a library project to Android Studio? - and unfortunately, it has not helped me. My goal is rather simple. I want to write an Android app using the Android Studio IDE (0.2.11), and the Guava libraries in my code. I do not know Gradle, I've only started using Android Studio and my Visual Studio/C# background has dumbed me down, for which I apologize (in that Mickey Mouse world, you typically just add a library reference and off you go). I will document my steps with screenshots. I mostly followed advice given in this

Android Studio 2.2 Google play services sync Error

不打扰是莪最后的温柔 提交于 2019-11-28 21:15:30
I have update to android studio 2.2 I started a new project and i included compile 'com.google.android.gms:play-services-vision:9.4.0+' in my dependencies. I am getting this Error when im launching the gradle sync. Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Error:com.android.builder.internal.aapt.AaptException: Failed to crunch file D:\Android\cloned apps\android-vision-master\android-vision-master\visionSamples\barcode-reader\app\build\intermediates\exploded-aar\com.google.android

Could not find method leftShift() for arguments after updating studio 3.4

蓝咒 提交于 2019-11-28 21:03:26
After updating studio 3.4 and Gradle version to 5.1.1 I got the error on my task as Could not find method leftShift() My task: task incrementBetaVersion << { println("Incrementing Beta Version Number...") incrementVersionNumber('BetaVersionNumber') println("Incrementing Beta Version Number...") incrementVersionName('BetaVersionName') } I got the error for the left shift operator << in the line. How to resolve this error? To solve this error, change << with doLast like this. task incrementBetaVersion { doLast { println("Incrementing Beta Version Number...") incrementVersionNumber(

What are the differences between gradle assemble and gradle build tasks?

谁都会走 提交于 2019-11-28 21:02:16
If I am not wrong gradle assemble does run gradle assembleDebug and gradle assembleRelease , but I believe gradle build also does the same, so what are the different between them both? Assemble will build your artifacts, and build will assemble your artifacts with additional checks. build depends on assemble , so build is sort of a superset of assemble You can have a look on the tasks that will be executed by using the --dry-run flag. e.g. gradlew build --dry-run You will see that apart from assemble also lint and test will be executed. From gradle tasks --all : Build tasks -----------

Android Gradle merged Values.xml uses wrong namespace

[亡魂溺海] 提交于 2019-11-28 20:48:36
In the process of converting a project to the Android build system I get this error whenever I attempt to compile. Gradle: Error parsing XML: prefix must not be bound to one of the reserved namespace names The merged values.xml file contains the following root element: <resources xmlns:ns1="http://www.w3.org/2000/xmlns/"> What is the cause of this error and how can it be fixed? I just spent around 2 hours digging through the Git commit that broke our Gradle build. This commit contained over 200 changed files with 4000+ modified lines. You can imagine how much fun it was ;) Anyway, here is what

Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

删除回忆录丶 提交于 2019-11-28 20:42:41
I tried using OkHttp and Picasso ( following this answer ) for disk caching of images that I was downloading from Firebase storage. Now, the app gives exceptions and crashes. I have seen these posts: post 1 , post 2 but I didn't find any relevant solutions. I also tried to clean and rebuild the project but had no luck. Here is build.gradle : apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "social.com.networking.social.media.app" minSdkVersion 16 targetSdkVersion 25 versionCode 1 versionName "1.0"

Could not find property 'xxxx' on com.android.build.gradle.AppExtension_Decorated

隐身守侯 提交于 2019-11-28 20:37:48
I got this error after I added these lines to my gradle file: buildTypes.each { it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey } then the log show: Could not find property 'MyOpenWeatherMapApiKey' on com.android.build.gradle.AppExtension_Decorated@c3b784 The solutions on google that I searched cannot solve my problem. Please show me where I was wrong? Since you are using a String you have to use this syntax: buildConfigField "String" , "OPEN_WEATHER_MAP_API_KEY" , "\"XXXXX-XXXXX-XXX\"" The last parameter has to be a String Otherwise you can use something like

Error after Updating play-services “Program type already present: com.google.android.gms.internal.measurement.zzabo”

泄露秘密 提交于 2019-11-28 20:29:14
I updated play-services dependencies to version 15.0.0 and also added play-services-safetynet to my app.gradle. After that i always get Program type already present: com.google.android.gms.internal.measurement.zzabo Message{kind=ERROR, text=Program type already present: com.google.android.gms.internal.measurement.zzabo, sources=[Unknown source file], tool name=Optional.of(D8)} when building the app. here is my app.build: apply plugin: 'com.android.application' android { signingConfigs { } compileSdkVersion 27 buildToolsVersion '27.0.3' defaultConfig { applicationId "XXXXXXX" minSdkVersion 19

With 0.4.3 Android Studio, error: “Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly”

我们两清 提交于 2019-11-28 20:21:51
I have noticed that several people are having issues after upgrading to Android Studio 0.4.3 (problem with 0.4.2 also I believe). My error and debug steps so far are as follows: The message I see is "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly" as shown in snapshot below. I found this thread and following instructions, but I still have the error. I am not able to do the following instruction in the thread: I went into Gradle settings and clicked on "use local Gradle distribution" and pointed it to*: C:/Users/robot_000/.gradle/wrapper/dists

Gradle for Android AAR Depending Upon AAR, Both In The Same Remote Repository?

ε祈祈猫儿з 提交于 2019-11-28 20:15:15
There are a few questions floating around regarding transitive dependencies with AAR files in Gradle: Android Studio 0.2.3 cannot resolve transitive aar dependencies Android Gradle library dependency with library dependency using Nexus Aar in repository. External dependency and NoClassDefFoundError I too have run into similar problems trying to set up transitive dependencies upon AAR files in a remote repository. I have App A, depending upon Library B, which in turn depends upon Library C. Library C is in a Maven repo. Library B is in the same repo, with a POM that contains the dependency upon