How to include javafx ports into Android Studio from path - android-studio

There are 3 important folders in android plugin(android-tools,lib,rt).Do We need to add all of them to our Android Studio project? And how to setup on build.gradle and MainActivity? I downloaded the javafx ports Android plugin(dalvik-sdk) and copied the files from "rt" folder to my projects libs folder. After that tried to setup my build.gradle as shown here:
How to run JavaFX in Android Studio and make ImageView
but it end up with black screen.I debug with physical device(Samsung Galaxy S5,Android version 6.0.1).
Tried to debug with virtual device Pixel Api_23.But it ended another error: "/data/app/com.example.fx_appfragment-2/lib/x86_64/libactivity.so" has unexpected e_machine

Related

failed to load jvm dll android studio Electric Eel

I was trying to install Android Studio Electric Eel on a laptop but after installation when I'm trying to open this error comes,
failed to load jvm dll android studio
I already,
Added JAVA_HOME in system variables,
Added path of Java bin folder,
try this, it's worked for me
just delete the jre folder and it starts working(restart android studio)...
C:\Program Files\Android\Android Studio\jre
The problem is because of traces of old Android Studio java folder,The new Android Studio Electric Eel is using jbr, not jre.
You also need to add your bin directory path in path System Variable
Edit System Variables and add your path as follow

Android Studio C++ Support Missing

I just installed Android Studio 3.6.3 on Windows 10 and I created a new Native C++ project. I can build and run the native project and I can debug Java code in the project.
The problems I'm having are:
I can't step into the C++ code when debugging
I can't set breakpoints in *.cpp files.
When I right click folders in the project view to add a new file, I only see options to add Java, Kotlin, and Android platform files. There aren't any options to add C++ source or header files.
When I open a C++ file Android Studio recommends installing plugins supporting *.cpp. The plugin it's recommending is for Arma 3 plugin development.
The "Attach Debugger To Process" menu only has Java as a debugger option. That list should also contain Native, Dual, and Auto.
I've made sure to install CMake and NDK (Side By Side) in the SDK Manager and I've configured the NDK in the project settings. I've tried reinstalling Android Studio 3.6.3 and I've also downloaded Android Studio 4.0 RC 1, but I have the same problems.
What steps am I missing to get C++ support in Android Studio?
Managed to get it working. Turns out just running the uninstaller wasn't enough, I had to follow the steps in this answer to completely uninstall Android Studio. I then reinstalled and everything seems to be good.

Flutter build.gradle trouble

I am currently starting Flutter Blue, a Bluetooth plugin for Flutter. I imported the example -> android -> app folder into Android studio.
However, when I am trying to build and run the code, I get the error: "Flutter SDK not found. Define location with flutter.sdk in the local.properties file. "
I googled around for a solution and added the flutter SDK path into the local.properties file but that hasn't remedied the issue yet.
flutter.sdk=/Users/me/Applications/flutter
I suspect that I am just not using Android Studio or importing the files/code correctly. I am able to compile and run Flutter's default demo app (click-counter) without any issues, so I'm fairly certain Flutter & Android Studio was installed and set up correctly.
My intuition was that the build.gradle could be directly run akin to an APK by Android Studio's device emulator. Any suggestions?
Thanks! https://github.com/pauldemarco/flutter_blue/tree/master/example/android
I was not importing the example correctly into Android Studio. The correct way is to drag and drop the project files into AS.

Android Emulator won't start from Android Studio on Windows 10

Recently (after install Android Studio 2.3.x, I'm now at 2.3.1) the emulator won't start in Android Studio.
I can run the emulator from the command line if it is in the SDK\tools directory.
If I run the emulator from a directory other than the SDK\tools directory I get an error like this:
[12236]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch '..\emulator/qemu/windows-x86_64/qemu-system-i386.exe': No such file or directory
The tools and platform-tools directories are in my path. Android_home is set correctly. First I tried re-installing the emulator from the SDK manager in Android (now that the standalone SDK manager is gone I can't do it there). I manually downloaded the SDK and installed it overtop of the old SDK. I then tried putting it in a new directory and changing the ANDROID_HOME and updating my paths and changed the setting in Android Studio (and all the local.properties files). Next I completely uninstalled Android Studio and SDK, rebooted and reinstalled Android Studio. Still having the same problem.
I've tried the suggestions here in the question here: Emulator on Android Studio doesn't start after SDK tools update to 25.3.1 by copying various directories (first sym-links then copy directories as sym-links work differently on windows).
I've tried all the suggestions here: https://issuetracker.google.com/issues/37137213 as well.
I've re-installed HAXM, but I don't think it is an Emulator problem as it does work when I start it from a command prompt in the tools directory.
Any suggestions?
Details:
Windows 10 (Build 1703)
Android Studio 2.3.1
I've resolved the problem in this way:
in command line, from the folder containing avd images, I've run the emulator.exe against a virtual device image using the switch -gpu swiftshader.
To be precise, in my case, in command line, from the folder C:\<Users>\.android\avd I've typed
<android sdk folder>\emulator\emulator.exe #Nexus_4_Lollipop -gpu swiftshader
where Nexus_4_Lollipop is a name of the avd image.
Changing Graphics settings from "Automatic" to "Software - GLES 2.0" in Virtual Device Configuration worked for me. I think it's the same as "-gpu" command line option, but not all modes available: https://developer.android.com/studio/run/emulator-acceleration.html

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.

Resources