Android Studio won't start on Linux - complaining about libcups - linux

My system is Gentoo Linux 64bit, and I have get the latest Android Studio for Linux. When I try to start it, I got this error message. Looking through the message, it looks like the reason is that I do not have the libcups.so library.
Caused by: java.lang.UnsatisfiedLinkError: /opt/icedtea-bin-7.2.4.3/jre/lib/amd64/headless/libmawt.so: libcups.so.2: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
Indeed, I do not have cups installed. But I don't understand why the Studio needs this library. Is there any way I can avoid installing this library and still get the Studio work?

Haven't used Android Studio, but I guess Android Studio uses CUPS for printing. Making it not need CUPS would require the removal of the printing code.

Related

How to use the kotlin compiler in command line which comes with Android Studio?

I have Android studio version 3.4.1. I am able to build Android apps with the Kotlin language. I have heard that we can use Kotlin for creating standalone programs other than building android apps.
So, I want to know how to run the Kotlin compiler of Android studio to compile and run Kotlin programs in the command line, without downloading anything else?. I am using Windows 10 Pro.
I'm on Lubuntu 16.04 LTS, not Windows. But maybe this can still help you.
In my Lubuntu, Android Studio put the Kotlin compiler in directory
$HOME/.AndroidStudio3.4/config/plugins/Kotlin/kotlinc/bin .
So on Windows, make your file manager show hidden files and directories - because on Lubuntu, the "." in ".AndroidStudio3.4" means "hidden".
Go to your home or user directory and find a directory named "AndroidStudio3.4" or similar. Then just follow the path given above.
On Lubuntu, kotlinc (the compiler) isn't executable. If it's the same on Windows, give it execution permission.
I can't imagine that giving this permission affects how Kotlin works in Android Studio. But if you want to be on the safe side, install a separate command line compiler or IntelliJ.
By the way, the Kotlin 1.3.40 REPL crashes (s. issue KT-32085). If you need it, use Kotlin 1.3.31 .

Couldn't launch android studio on Ubuntu 18.4 LTS Error: Could not find or load main class Dsun.java2d.d3d=false

I have followed the steps [here] (Android Studio is slow (how to speed up)?) in order to try and make my android studio faster.
after doing so android studio won't even launch .
I have tried the command ./studio.sh from the terminal but I am getting this
error: Error: Could not find or load main class Dsun.java2d.d3d=false
Fixed it by:
going to dir home/username/AndroidStudiox.x/config/studio.vmoptions
I had added a couple of lines there before
I edited the file and deleted it's contents. and I was able to launch android studio again

Open cocos2d-x-3.7 in Android Studio

What is the proper way to open cocos2d-x-3.7 in Android Studio?
I tried:
Open existing project in Android Studio project > Choose proj.android-studio directory (In another attempt, I also tried to choose the base directory MyGame)
Run
Error: couldn't find "libcocos2dcpp.so.
Moreover, it also does Classes directory in the Project.
Android Studio is only partially supported in cocos2d-x 3.7 and 3.8. With the default project you will only be able to run your app without debugging using Android Studio.
Prior to running your app in Android Studio you will have to compile using the Android Studio flag:
cocos compile -p android --android-studio
You will have to run this command after any changes to your app are made, since the default Android Studio currently doesn't compile your project.
Furthermore the default Android Studio project does not include the Classes directory.
Suggestion: Use Eclipse or Xcode to develop your cocos2d-x projects for now. Hopefully future versions of cocos2d-x will have better support for Android Studio out of the box, this is critical considering Google is dropping support for Eclipse.
When you try to run the application on Android Studio, you get the error couldn't find "libcocos2dcpp.so" because it doesn't have the NDK for building your game.
I recommend you to compile proj.android and import that, cocos2d-x 3.7 doesn't support full Android Studio yet. Do this:
cocos compile -p android
Then import your proj.android to Android Studio.
Now you can run your application but you won't able to debug it, bad news (it will just install the APK on your device or virtual device).
Hope it helps.
Error: couldn't find "libcocos2dcpp.so.
For this you need to compile android studio project first so .so files and classes folder will be generated.
Open your command line and enter the following command to compile your android studio project:
cocos compile -p android --android-studio --ap android-24 --app-abi x86
This will create required files in your proj.android-studio directory.
Now import this project into Android Studio and try to run it.

Cygwin + Linux NDK on Windows

I think this sounds strange but it's my situation now.
I have an Android JNI project on Eclipse (Windows), but after my friend 's configuration in his Eclipse on Ubuntu, now the auto-build plugin on my Eclipse couldn't work (It raise the error: ...ld.exe: can not find -l):
**** Build of configuration Default for project TachoPro ****
ndk-build.cmd all
SharedLibrary : libtachometer_core.so
E:/Android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: cannot find -ltachometer_core_armv7_a_cortex_a9
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libtachometer_core.so] Error 1
**** Build Finished ****
He said that I must download the NDK for Linux then use Cygwin to build. But another error (seems more complex than before) arrives:
http://www.mediafire.com/view/?o0nthcn3hn0b0ix
If you has been through this, please give me some advices... >"<
If you're working on Windows, you have to use the Windows version of the Android NDK, not the Linux.
If you took a configuration file from your friend which points to a linux executable, you need to fix that. only that.
can you post the configuration file he gave you ?
read about how to develop with Android and with the NDK, you don't need Cygwin to develop with the NDK under Windows, also Cygwin it's not meant to be an environment for developers ( it's written crystal clear in the project homepage ! ).
I don't know what you 2 are doing but surely it's not Android related or a good use of both Cygwin or Android tools.

Various issues installing igraph in Visual Studio 2010 and Cygwin/MinGW ("sys/time.h not found")

I couldn't get igraph to work with Visual Studio 2010 (supposedly many known issues), and so decided to try installing it in Cygwin. ./configure went fine. But make gave this error:
f2c/dtime_.c:16:23: fatal error: sys/times.h: No such file or directory
Makefile:2190: recipe for target `libf2c_la-dtime_.lo' failed
make[3]: *** [libf2c_la-dtime_.lo] Error 1
I tried installing it in MinGW and get the same error when I make. Should I be providing "sys/time.h" or a path to it? Where is sys/time.h? Using Windows 7.
Edit
The problems in Cygwin and MinGW was due to the wrong version of gcc being used by my clean installation of Cygwin (and a characteristic of MinGW). Solution here: Installing/compiling in Cygwin/MinGW - How to set the include "path"? (symbolic link?)
The problem in Visual Studio 2010 was due to building in "Debug" instead of "Release". One of igraph's creator, Gábor Csárdi, graciously provided an excellent step-by-step guide below that identified and resolved it.
Igraph actually does work with Visual C++ 2010 Express, we test this before releases, and I have just tried it. You need to do the following steps.
Download the source package specifically created for Visual Studio.
Uncompress the file into My Documents\Visual Studio 2010\Projects.
Open the igraph.sln solution file in igraph-0.6-msvc\igraph-0.6-msvc directory from Visual Studio.
Visual Studio offers to convert the solution file to the current format, do that. Just click on Next, Next and Finish.
On the toolbar, change 'Debug' to 'Release' to make release builds.
Choose Debug -> Build solution and wait until the library is built.
To test it you can open the solution file in the igraphtest directory, convert it as well, choose 'Release' builds, and then build it and run it from the command line. It is a simple C++ program that uses igraph to create a graph and write it into the file out.txt.
You don't have to set up include and library directories at all, everything is set up properly in the solution file, both for igraph and igraphtest.
is there an sys/times.h file?
I have a vague memory that I had to make that symlink on a system once.

Resources