error: package com.google.common.collect does not exist - build.gradle

I've tried looking at answers to similar questions and I followed their instructions, but I'm still getting in the following error.

This is a missing dependency problem. Add Guava to your dependencies.
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
Add the above line in the dependencies section of your build.gradle in the flow module (and contract as well if you are using the dependencies in contract module).

Related

Error Implementing lib module dependency by creating .aar file in build-gradle (app) file

I am facing the following issue whenever I try to implement the .aar file instead of the direct lib module dependency.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find :xxxlib-release:.
N:B: I have configured the library project for jitpack also with the publishing config. A few days back, there was no issue but now I am getting errors for both the .aar and jitpack versions of my library which I guess is related. Additionally, I have upgraded to Android Studio Bumblebee and using targetSdkVersion 29 or 30; kotlin = 1.6.0 and classpath 'com.android.tools.build:gradle:7.0.3'
I can't find out what am I missing here. Any help will be appriciated, thanks.

Gradle DSL method not found: 'debugImplementation()'

I have included the below dependencies in the gradle.build(app) file to check the memory leaks. But when included the below two dependencies I am getting an error.
dependencies {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
}
Error : Gradle DSL method not found: 'debugImplementation()'
Android Gradle Plugin Version is 3.5.3. And Gradle Version is 5.6.2
Please help in fixing the error.
Put the dependencies in module gradle file, not project gradle.

Adding Spark CSV dependency to Zeppelin

I'm running an EMR with a spark cluster on AWS.
Spark version is 1.6
When running the folllowing command:
proxy = sqlContext.read.load("/user/zeppelin/ProxyRaw.csv",
format="com.databricks.spark.csv",
header="true",
inferSchema="true")
I get the following error:
Py4JJavaError: An error occurred while calling o162.load.
: java.lang.ClassNotFoundException: Failed to find data source: com.databricks.spark.csv. Please find packages at
http://spark-packages.org
at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.lookupDataSource(ResolvedDataSource.scala:77)
How can I solve this? I assume I should add a package but how do I install it and where?
There is many way to add packages in Zeppelin :
One of them is to actually change the conf/zeppelin-env.sh configuration file adding the packages you need e.g com.databricks:spark-csv_2.10:1.4.0 in your case to the submit options since Zeppelin uses the spark-submit command under the hood :
export SPARK_SUBMIT_OPTIONS="--packages com.databricks:spark-csv_2.10:1.4.0"
But let's say that you don't have actually access to those configuration. You can then use Dynamic Dependency Loading via %dep interpreter (deprecated) :
%dep
z.load("com.databricks:spark-csv_2.10:1.4.0")
This will require that you load the dependencies before launching or restarting the interpreter.
Another way to do it is do add the dependency you need via the interpreter dependency manager as described in the following link : Dependency Management for Interpreter.
Well,
First you need to download the CSV liv from Maven repository:
https://mvnrepository.com/artifact/com.databricks/spark-csv_2.10/1.5.0
Check the scala version that you are using. If is 2.10 or 2.11.
When you call spark-shell our spark-submit or pyspark. Or even your Zeppelin you need to add the option --jars and the path to your lib.
Like this:
pyspark --jars /path/to/jar/spark-csv_2.10-1.5.0.jar
Than you can call it as you did above.
You can see other close issue here: How to add third party java jars for use in pyspark

unable to install nex/yii2-chosen extension

I am unable to install nex/yii2-chosen extension in my project using composer please.
My composer shows :
C:\xampp\htdocs\labplus>composer require nex/yii2-chosen Deprecation
Notice: The Composer\Package\LinkConstraint\MultiConstraint class is
deprecated, use Composer\Semver\Constraint\MultiConstraint instead. in
phar://C
:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstrain
t/MultiConstraint.php:17 Deprecation Notice: The
Composer\Package\LinkConstraint\LinkConstraintInterface interface is
deprecated, use Composer\Semver\Constraint\ConstraintInterface inst
ead. in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Packa
ge/LinkConstraint/LinkConstraintInterface.php:17 Failed to decode
response: zlib_decode(): data error Retrying with degraded mode, check
https://getcomposer.org/doc/articles/troubles hooting.md#degraded-mode
for more info Using version dev-master for nex/yii2-chosen
./composer.json has been updated Loading composer repositories with
package information Updating dependencies (including require-dev) Your
requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package dbtek/chosen-bootstrap could not be found in any ver sion, there may be a typo in the package name. Problem 2
- The requested package nex/yii-chosen could not be found in any version, th ere may be a typo in the package name.
Installation failed, reverting ./composer.json to its original
content.
see the cmd snap for more

How to add javax.swing.SwingUtilities dependency to SBT?

I'm starting to develop a Scala application with Swing using SBT. I figured out that I need two dependencies for a start, so that's scala-swing and javax.swing.SwingUtilities.
I've been searching the web, maven repositories and github, but stil couldn't find, where did the javax.swing package go.
So far I have found javax in Maven Repos, but javax.swing is not listed there for some reason.
I tried to add a javax dependency to my Build.scala:
val javax = "javax" % "javaee-api" % "7.0"
SBT downloaded several packages. Then I launched the terminal:
scala> import javax.swing.SwingUtilities
import javax.swing.SwingUtilities
scala> SwingUtilities.invokeLater()
<console>:9: error: not enough arguments for method invokeLater: (x$1: Runnable)Unit.
Unspecified value parameter x$1.
SwingUtilities.invokeLater()
^
That's scala console being launched from sbt project. So as you can see, import was successful and the console knows about invokeLater() method. But IntelliJ Idea still does not, it marks javax.swing as unresolvable, though it has downloaded the packages.
I'm completely stuck here.
javax.swing is part of any standard Java SE installation (see http://docs.oracle.com/javase/6/docs/api/ - there you have SwingUtilities), so there is no need to add a dependency. You only need the scala-swing dependency:
libraryDependencies += "org.scala-lang" % "scala-swing" % scalaVersion.value
If IntelliJ IDEA doesn't see javax.swing, you have probably not yet defined an "SDK". Go to File -> Project Structure -> Platform Settings -> SDKs. There you should have at least one entry such as "1.6" for Java 1.6 or "1.7" for Java 1.7. If not, press the "+" to add one and locate the appropriate Java home directory for the version you want to use (depends on your OS).