IntelliJ Error When Importing Rust Project - intellij-idea

I wanted to work on a Rust project and wanted to use IntelliJ and for this I installed Rust plugin:
https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-quick-start.html
I then imported my project in IntelliJ, but somehow I'm not able to see the gutter menu next to my test case. I do not understand what I'm missing. I can see at the bottom in the Build window that there is something that fails.
Updating Workspace Info.
Execution failed (exit code 1).
/home/joesan/.cargo/bin/cargo metadata --verbose --format-version 1 --all-features
stdout : error: no override and no default toolchain set
error: backtrace:
error: 0: error_chain::backtrace::imp::InternalBacktrace::new
1: rustup::config::Cfg::find_or_install_override_toolchain_or_default
2: rustup_init::main
3: std::rt::lang_start_internal::{{closure}}::{{closure}}
at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:52
std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/sys_common/backtrace.rs:130
4: main
5: __libc_start_main
6: <unknown>
stderr :
rustup show gave me the following:
Default host: x86_64-unknown-linux-gnu
rustup home: /opt/softwares/rustup
stable-x86_64-unknown-linux-gnu (default)
rustc 1.46.0 (04488afe3 2020-08-24)
Any ideas how to get this fixed?

I fixed it by opening the Rust project in IntelliJ, navigate to File -> Settings -> Rust and then set the Standard library to the following:
/opt/softwares/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib
That is the location where I installed the Rust Toolchain. Somehow Intellij was not picking it up and I had to set it manually.

Related

Gradle build doing nothing on WSL

I'm writing a Kotlin program, and using Gradle as the build system, as is customary in that language. I usually work on Windows, but it's time to start testing on Linux, so using WSL for that. Installed Gradle, cloned a copy of my code in WSL...
(base) a#DESKTOP-4B7M920:~/ayane$ gradle -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/java/groovy-all.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------
Build time: 2012-12-21 00:00:00 UTC
Revision: none
Groovy: 2.4.16
Ant: Apache Ant(TM) version 1.10.5 compiled on March 28 2019
JVM: 11.0.7 (Ubuntu 11.0.7+10-post-Ubuntu-2ubuntu218.04)
So far so good, that warning happens sometimes, doesn't seem to portend immediate trouble.
This is my build file, that works on Windows:
(base) a#DESKTOP-4B7M920:~/ayane$ cat build.gradle.kts
plugins {
kotlin("jvm") version "1.3.72"
}
repositories {
jcenter()
}
dependencies {
implementation(kotlin("stdlib"))
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
Here goes.
(base) a#DESKTOP-4B7M920:~/ayane$ gradle build
> Task :buildEnvironment
------------------------------------------------------------
Root project
------------------------------------------------------------
classpath
No dependencies
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
<-------------> 0% WAITING
Uh? I could understand if it threw an error because some prerequisite or other was unavailable. But no error, just nothing? What's going on?
You are using the newest version at this time of the Kotlin plugin for Gradle (1.3.72). However, you are using a really old version of Gradle (4.4.1). As you can read from the Kotlin documentation:
The Kotlin Gradle plugin 1.3.72 works with Gradle 4.9 and later.
It is unfortunate that the plugin doesn't check for this and give a more proper error message instead of just silently doing nothing. I guess you could create an issue for Jetbrains on this if you like.
Just as has been mentioned in the comment to your question, I also highly recommend using the wrapper. It ensures that the project is built with a particular declared version of Gradle that you, the build author, has decided on. Otherwise, you will have to document how to set up the environment correctly, including what version of Gradle to install.
Same thing goes for Java: be sure to clearly document which version is required or supported.
As for building in WSL, the only issue I've ever had with it was a remote build cache not working. This was because I had configured Git to checkout with POSIX line endings (LF) for source files, whereas the cache were populated on a Windows machine using CRLF line endings). It doesn't sound like you are using that feature, but other than that, everything has been working fine for me in WSL.

Error in Mulesoft Anypoint sudio not able to run or deploy mule project in Anypoint Studio

I am getting below error in Anypoint Studio while running or deploying mule application I followed the steps given in the web link of the error but still getting same error.
[ERROR] Unknown lifecycle phase ".m2\repository". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
There are two ways to fix this, either use the Run/Debug configurations, and add the build target there. Or you can specify what maven should use as default settings. (See screenshot for sensible defaults (skip unit tests as they often fail during development) )

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

Android Gradle - Gitlab CI - Docker - CMake - NullPointerException

I'm trying to get simple Android Unit Tests to run on Gitlab CI, but I'm having troubles getting things to build correctly in the CI Docker image. I have the master project which pulls from a Library project. The Library has C code in it, so I need to use CMake to get it to build. All of this is working locally on my windows machine when using Android Studio. However, once I move to the CI server, things break with the following error:
Using incremental javac compilation for :Library debug.
Incremental java compilation is an incubating feature.
Checking the license for package CMake 3.6.3155560 in /android-sdk-linux/licenses
License for package CMake 3.6.3155560 accepted.
Preparing "Install CMake 3.6.3155560 (revision: 3.6.3155560)".
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" ready.
Finishing "Install CMake 3.6.3155560 (revision: 3.6.3155560)"
Installing CMake 3.6.3155560 in /android-sdk-linux/cmake/3.6.3155560
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" complete.
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" finished.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Library'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':Library'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
...
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NullPointerException
at com.android.builder.sdk.DefaultSdkLoader.installSdkTool(DefaultSdkLoader.java:572)
at com.android.build.gradle.internal.SdkHandler.installCMake(SdkHandler.java:302)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.create(ExternalNativeJsonGenerator.java:628)
at com.android.build.gradle.internal.TaskManager.createExternalNativeBuildJsonGenerators(TaskManager.java:1241)
at com.android.build.gradle.internal.LibraryTaskManager.lambda$createTasksForVariantData$11(LibraryTaskManager.java:240)
...
at com.sun.proxy.$Proxy15.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82)
... 56 more
BUILD FAILED
Total time: 1 mins 25.384 secs
Stopped 0 worker daemon(s).
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':Library'.] from daemon DaemonInfo{pid=39, address=[1f3b75f9-7080-48b5-b298-0e6136640a0a port:41964, addresses:[/127.0.0.1]], state=Busy, lastBusy=1496784783851, context=DefaultDaemonContext[uid=0e3eadf0-a7bd-4ede-9eb8-0c2a96ebef58,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/root/.gradle/daemon,pid=39,idleTimeout=10800000,daemonOpts=-Xmx1536m,-Dfile.encoding=UTF-8,-Duser.country,-Duser.language=en, -Duser.variant]} (build should be done).
ERROR: Job failed: exit code 1
Judging by the line
Caused by: java.lang.NullPointerException
at com.android.builder.sdk.DefaultSdkLoader.installSdkTool(DefaultSdkLoader.java:572)
at com.android.build.gradle.internal.SdkHandler.installCMake(SdkHandler.java:302)
it looks like it is a problem with the CMake. But it looks like it is installed and the licence is accepted as noted by the output at the start of that block above.
Can anyone give me some pointers on what is the problem?
* Is it that gradle doesn't know where CMake was installed?
* Is it a problem perhaps with the NDK?
* Or perhaps where I can find the source code for com.android.build.gradle.internal.SdkHandler.installCMake and com.android.builder.sdk.DefaultSdkLoader.installSdkTool.
My searches have been unfruitful.
I can provide more about my setup upon request. (i.e. android project, docker image, gitlab-ci.yml, etc.)
Well, mbertin commented on Feb 2 at here that by using a lower gradle build tool, it solved the problem for him. (i.e. classpath 'com.android.tools.build:gradle:2.2.2).
After giving it an attempt, my build script got passed that error! (anyone know why?)
Thanks for the emotional support Stack Overflow! You are the best!

Can't use SpeechKit Titanium module from iOS in my app

I want want to use Speechkit SDK in my app, since I found it recognize words better than the native tool did.
I found a Titanium module on GitHub but it is designed to work with Titanium SDK 3.1.3.GA . I am currently working with SDK 5.0.0.GA.
What am I supposed to do to import this module in my mobile app ? I updated the titanium.xcconfig file to reflect the version of my SDK. I also put my credentials into it and build the project. Then I compressed it and installed it via Help Menu > Install Mobile Module. I finally added it to the tiapp.xml file.
When I try to run the project, this is what I get :
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld Build/Intermediates/Hello5.build/Debug-iphoneos/Hello5.build/Objects-normal/arm64/Hello5 normal arm64
[ERROR] : Ld Build/Intermediates/Hello5.build/Debug-iphoneos/Hello5.build/Objects-normal/armv7/Hello5 normal armv7
[ERROR] : (2 failures)
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/feeder/.appcelerator/install/5.0.1/package/node_modules/appc-cli-titanium/plugins/run.js:89:66)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
I tried to create a new module by hand and drag-and-drop files into it, and also tried to install globally vs project-specific, I can't come with an idea for making it work. Thank you in advance if you could share an idea ;)
I have the same error and looking the console using Trace appears "framework SpeechKit not found".
I've successfully resolved this error by packaging the module to your project directly selecting "Mobile App Project" given that Module.xcconfig sets "FRAMEWORK_SEARCH_PATHS" to find SpeechKit framework on "assets" folder from the project directly.