sbt.compiler.EvalException: Type Error in Expression - intellij-idea

I'm quite new with IntelliJ (and on this site too tbh) and have been using it for only a couple of days. When I tried to build my project this exception came up. I tried to solve the problem but to no avail. I tried to see if the same problem occured on a newly created project and yes it does. So the code I've written should have no influence on the build. IƤve also checked if there might be a problem with the sbt version but I am up to date.
This is what the error looks like. I have absolutely no clue how to solve this so any help would be very much appreciated.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from C:\Users\Johner-Institut\.sbt\0.13\plugins
Waiting for lock on C:\Users\Johner-Institut\.ivy2\.sbt.ivy.lock to be available...
[info] Loading project definition from C:\Users\Johner-Institut\Desktop\Project\project
C:\Users\Johner-Institut\Desktop\Project\build.sbt:5: error: recursive value project needs type
lazy val `project` = (project in file(".")).enablePlugins(PlayScala)
^
sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

Don't use project as a name for sbt project, that's why the recursion error. Try something like:
lazy val root = (project in file(".")).enablePlugins(PlayScala)

Related

Adding sub module to project causing gradle build failures in Android studio 3.0 with gradle version 4.1

I added sub module library vertical-stepper-form version 0.9.8, while I set dependency of this library on my app module. I was able to do it successfully.
I am using Android Studio 3.0 with gradle version 4.1, few of the classes in project are in kotlin and others in java
When I started gradle sync it gave me this error. The gradle is not building and showing below issues :
/*********************************/
Information:Gradle tasks [:vertical-stepper-form:generateDebugSources,
:vertical-stepper-form:generateDebugAndroidTestSources,
:vertical-stepper-form:mockableAndroidJar,
:app:generateInstallDebugSources,
:app:generateInstallDebugAndroidTestSources, :app:mockableAndroidJar]
D:\Devavrata\project/package/src/main/res/abc.xml Error:error:
attribute 'com.spireon.install:src' not found.
D:\Devavrata\AbcProject\abc-Android\app\build\intermediates\incremental\mergeInstallDebugResources\stripped.dir\layout\activity_main.xml
Error:attribute 'com.spireon.install:src' not found. Error:failed
linking file resources. Error:java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details Error:java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error:
check logs for details Error:Execution failed for task
':app:processInstallDebugResources'.
Failed to execute aapt Information:BUILD FAILED in 24s Information:7 errors Information:0 warnings Information:See complete output in
console
/********************************/
What I have already tried :
I tried with changing import lines in xml also changing the android:src and srcCompat properties. Along with build/project cleaning and invalidating the cache.
Changing this line in gradle.properties
android.enableAapt2=false
Let me know if anyone has faced this issue

IntelliJ IDEA 2017 - sbt 0.13.X not found

I have a problem with IntelliJ IDEA 2017 and sbt. Though I don't use any proxy or something like this, I get the following error during every time I try to create new sbt project or create new one:
Getting org.scala-sbt sbt 0.13.13 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;0.13.13
==== local: tried
C:\Users\HN48DH\.ivy2\local\org.scala-sbt\sbt\0.13.13\ivys\ivy.xml
-- artifact org.scala-sbt#sbt;0.13.13!sbt.jar:
C:\Users\HN48DH\.ivy2\local\org.scala-sbt\sbt\0.13.13\jars\sbt.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.pom
-- artifact org.scala-sbt#sbt;0.13.13!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.13: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
SERVER ERROR: Parent proxy unreacheable url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.pom
SERVER ERROR: Parent proxy unreacheable url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.jar
SERVER ERROR: Parent proxy unreacheable url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
SERVER ERROR: Parent proxy unreacheable url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.13: not found
Error during sbt execution: Error retrieving required libraries
(see C:\Users\user-name\.sbt\boot\update.log for complete log)
Error: Could not retrieve sbt 0.13.13
Process finished with exit code 1
I really run out of ideas what might be wrong. I'd be grateful for Your help.
Just trying to help, if you go to the link from your error message:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.pom
It gives me: "404 Not Found" so your IDE tries to download SBT from a wrong location. Maybe the repository location have changed.

Cannot refresh gradle project in IntelliJ

Why does this happen? There is no reason, I'm just trying to press the refresh button and it never works.
Error:Timeout waiting to lock buildscript class cache for build file '/home/dac/proj/spring-boot-master/spring-boot-samples/spring-boot-sample-jetty-jsp/build.gradle' (/home/dac/.gradle/caches/2.3/scripts/build_68kj36zmyqst1ei1zilpv1rml/ProjectScript/buildscript). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 9475
Owner Operation: unknown
Our operation: Initialize cache
Lock file: /home/dac/.gradle/caches/2.3/scripts/build_68kj36zmyqst1ei1zilpv1rml/ProjectScript/buildscript/cache.properties.lock
The issue you are seeing is likely related to GRADLE-2795. Try to upgrade Gradle to 2.14 (which is the latest final version of Gradle at the time of writing). It should have this issue fixed.

Error Compiling Scala Spark using SBT Console in IntelliJ IDEA

I tried to compile Scala Spark project that I got using get-idea following this tutorial https://anitatailor.wordpress.com/2013/10/09/setting-up-spark0-8-0-with-intellijidea/
But when I tried to compile Scala Spark using SBT Console in IntelliJ IDEA, I got some errors.
You may see the error logs below
java -Dsbt.log.noformat=true -Djline.terminal=jline.UnsupportedTerminal -Xmx512M -XX:MaxPermSize=256M -jar C:\Users\Priska\.IdeaIC14\system\sbt\sbt-launch.jar
[info] Loading project definition from D:\spark-incubating\project\project
[info] Compiling 1 Scala source to D:\spark-incubating\project\project\target\scala-2.9.2\sbt-0.12\classes...
[error] error while loading CharSequence, class file 'D:\IDEA\jre\jre\lib\rt.jar(java/lang/CharSequence.class)' is broken
[error] (bad constant pool tag 15 at byte 1501)
[error] error while loading Comparator, class file 'D:\IDEA\jre\jre\lib\rt.jar(java/util/Comparator.class)' is broken
[error] (bad constant pool tag 15 at byte 5003)
[error] two errors found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Can you help me to solve the problem?
Any help would be appreciated.
Thank you

NullPointerException org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)

Got the following stacktrace when launching gradle 1.1, anyone know how to resolve them:
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:28)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I think the automatic unzip of the dists/gradle-1.1-bin/13d7lnhcrghv2i5e54el41jpgr/gradle-1.1-bin.zip might be failing. I checked permissions and that I have access to that directory.
If I unzip manually, then I get the following error:
Exception in thread "main" java.lang.RuntimeException: Gradle distribution 'http://services.gradle.org/distributions/gradle-1.1-bin.zip' contains too many directories. Expected to find exactly 1 directory.
at org.gradle.wrapper.Install.createDist(Install.java:73)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I did a google search for gradle nullpointerexception and it mentioned the JAVA_HOME needs to be set for compiling, but I've already checked it is set correctly and been able to compile stuff with ant in that environment.
I was getting exactly same error and I changed the version of gradle that I was using. Inside my gradle-wrapper.properties, changed version 2.4 to 2.2.1 and error is gone.