I'm trying to implement the arcore_flutter_plugin and my code is very similar to the example given.
However, whenever I start the app, I get this output. The line I think matters the most is: java.lang.IllegalStateException: Couldn't create Engine
flutter doctor says there are no issues.
Please help, I really need this to work. I've looked everywhere and couldn't find a solution. Thank you!
Here's some more info:
Operating System: Manjaro i3 18.04
CPU: Intel Core i3 (this might be the issue)
Flutter Version: v1.5.4
Android SDK Version: 28.0.3
Android Studio(which I don't use): v3.4
Filament is a rendering engine used by SceneForm which is used by ARCore. The error is likely due to not having OpenGL ES 3.0 supported by the device (or basically any error related to not being able setup 3D rendering). I guess you're running it in emulator. If this is the case make sure to read here the Section Configure the emulator to support Sceneform.
You may also need to install the ARCore service APK for x86. (See section Update Google Play Services for AR in the linked doc).
If you are running the app on real HW, make sure you have one of supported hand-sets.
Related
Before we start allow me to just say that I know that it is possible to integrate Gstreamer into Android natively using C code as done in the Android Tutorials themselves.
This question is not related to simply just getting Gstreamer running on Android but rather running it on Android using the pre-existing native Java wrapper library gst1-java-core alongside JNA inside of Android Studio in a new Native project. However, if Native C code is the only way do let me know if you have tried and failed what I'm trying to do.
Lets begin.
System Information:
OS: Linux Ubuntu 18.04
Android Studio Version: 4.1.2
Java version: 8
SDK version: 30 (targetting API 21)
NDK version: 21 (also tried 23)
Testing Device: Samsung Galaxy Tab S6 Lite (even though haven't gotten there yet)
Process involved setting up a brand new project in Android Studio and choosing Native C++ as the Project Template followed by keeping everything else default including the toolchain. Once the project was built and finished it's Gradle business I did the usual git init and set it up in Git. Following that I downloaded and added the gst1-java-core-1.4.0.jar from the releases page to the "libs/" directly inside the "app/" folder.
Once I had done so I modified the build.gradle file in the app directory to match this Gradle Gist.
This was then naturally followed by a Gradle sync and when that had completed correctly I went to my MainActivity.java and added two lines of code total.
First at the top:
import org.freedesktop.gstreamer.Gst;
and then inside the onCreate method:
Gst.init();
This then produced this error:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.rcbappnative, PID: 9644
java.lang.UnsatisfiedLinkError: Could not load library: gstreamer
at org.freedesktop.gstreamer.lowlevel.GstNative.load(GstNative.java:56)
at org.freedesktop.gstreamer.lowlevel.GstNative.load(GstNative.java:46)
at org.freedesktop.gstreamer.lowlevel.GstAPI.<clinit>(GstAPI.java:37)
at org.freedesktop.gstreamer.Gst.getVersion(Gst.java:144)
at org.freedesktop.gstreamer.Gst.init(Gst.java:473)
at org.freedesktop.gstreamer.Gst.init(Gst.java:419)
at com.example.rcbappnative.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7963)
at android.app.Activity.performCreate(Activity.java:7952)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3629)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
I then proceeded to attempt to rectify this by following Gstreamers installation instructions for Android by downloading the binaries that matched my NDK version (gstreamer-1.0-android-universal-1.18.3.tar.xz) and then extracting them to a folder that was then pointed to by the environment variable GSTREAMER_ROOT_ANDROID=/home/user/Android/gstreamer
I added this environment variable to ~/.project as well ~/.bashrc and sourced either of them and tried to build and run but nothing changed.
I then attempted to add it to both local.properties and gradle.properties simultaneously (and also either one at a time) and still the same error would occur.
The Java Examples provided by gstreamer-java's github works on my machine just fine so it appears that it is not a system wide error but rather an Android environment specific error where it somehow fails to load the library. Perhaps because it doesn't know to look for that environment variable.
So the question now is; has anyone gotten gst1-java-core to work with Android through JNA or can anybody point me in the right direction regarding what I am possibly doing wrong in relation to importing this library? Any help would be very much appreciated.
So it was my mistake not knowing enough about Android and the sub systems to know that even though Android is primarily developed in Java it does not support running Java "natively". This means that JNI is not relevant as according to Wikipedia JNI is:
In software design, the Java Native Interface is a foreign function interface programming framework that enables Java code running in a Java virtual machine to call and be called by native applications and libraries written in other languages such as C, C++ and assembly
So in saying that - because Android does not run a JVM but rather it runs Native C on a Linux Kernel this means that trying to integrate a "java wrapper" through the JNI is not currently possible on Android.
Because of this - the common solution and following Gstreamers official tutorials appears to currently be the only way to use Gstreamer in Android.
I only have myself to blame for thinking that everyone else had just "missed" JNI and gst1-java-core and that I somehow knew better than even the Gstreamer official website itself.
I felt like answering this question though because if anyone else goes down the wrong track I can now officially suggest to following the official tutorials and create an Android App with Native support so that you can compile and integrate the C code directly from Gstreamer and then make your app work like that.
I can currently say that following the above paragraph's advice resulted in me creating a working Android application with a Gstreamer live stream currently up and running using a custom pipeline. I'm not going to say it was easy; because it isn't; especially if you are not great at C programming. But it is definitely doable and the tutorials are good.
I recently upgrade to the latest android studio, although i had not use it in a long time. My code build up and sync successful but I get the error below each time I tried to the app in an emulator. pls note, I use Window 10 on AMD based system
Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration
I had installed and enable "Intel HAXM". I have browsed through a few similar question but none provides a solution.
Please not this question is a different scenario to what you have the question Emulator: ERROR: x86 emulation currently requires hardware acceleration:
No information about Intel HAXM status nor CPU acceleration status
The version of Android Studio is way different
possible difference in the way SDK Manager was back in 2015 and now
The answer you posted is just a workaround.
As a i solution (i have the same AMD platform - 2700X my cpu), you need to enable from BIOS - your virtualisation technology (i have a Aorus motherboard and its called SMT), and then from the OS - Turn Windows Features ON or OFF - install
After this option is installed, you should be able to run the AVD with proper emulation. I already uninstalled HAXM and had no issues without it.
Also, i did not install any Hyper-V
PS:
As of 26 Oct 2019, Google added support for AMD CPU as per their blog: https://androidstudio.googleblog.com/2019/10/android-emulator-hypervisor-driver-for.html
You need to make sure you disable the previous settings provided by me up above, and follow their guide.
I found the answer by Alex8752 on the post Android Studio - How Can I Make an AVD With ARM Instead of HAXM? as guideline to resolve the above issue.
Basically since I use AMD system, I downloaded and installed arm* image from "Other Image" within System Image (I will recommend armeabi-v7a for x86-64 based systems). Thanks to everyone.
Well I'm trying to setup libgdx. I used the setup-ui and installed everything on eclipse, but I get this error when I try to run my desktop project : http://pastie.org/8399448
I'm running ubuntu, and I think this might have something to do with why my android emulator won't work in eclipse, but I don't really need it because i'm not planning to make it into an android app. Thanks for taking time to read this/help me. I really appreciate it.
I think you're missing some basic OpenGL setup on your system. Its not Libgdx-specific. For example does glxgears run?
See OpenGL GLX extension not supported.
The answer is probably going to be very to Ubuntu and the video card your machine is using. You might have more luck at askubuntu.com.
What alteration should be made in a Java Application to be able to install it on Java Enabled Smartphone?
I tried using a random app of mine to see what happens, when I open it on the cell, it says Install? I say yes, and it says invalid file.
Now I was wondering what alteration should be made?
My smartphone (Samsung S8500) runs on bada which is more or less the same as Android, but alterations in the General.
You need different SDK for smartphones. Like for Android, you need Android SDK 1.5 or any other version. You just cannot install the same application. You need to develop using the resources provided by the SDK.
If your application is Java based mobile application then you can use some tools to convert it for Android. Doesn't work every time but worth a try.
In your case, Bada OS is not like Android what i learn from here. So, you need to develop the application using J2ME .
I'm trying to write some apps using wikitude, and I'm having some problems running even the example.
I've put the sample ( BasicOpenARDemo ) that comes with the SDK inside eclipse and tried to run it, where I encountered the next error: "wikitude was not found on the system. Please press the ok-button to access the Android market and download wikitude."
First question- I don't understand- Why am I approached to download the utility when I have a standalone sample inside my eclipse? Doesn't the core files behind Wikitude come with the SDK or the sample itself?
The next question will be - after some googling, I've found that in order to install this "Android market" I need to follow the manual that comes in the 9th message in the next thread (the message that was written by ronni.rasmussen) -
http://forum.xda-developers.com/archive/index.php/t-529170.html
Well, I've followed it, and now when I try to press the OK button that comes after the "wikitude was not found on the system..." message, I get redirected to the Android market, where I find Wikitude, but when I try to download it- I get a "Download was unsuccessful. Please try again" error message. How do I fix that?
One more thing that I don't understand- How come it's written in this offline Android market that the available wikitude version is for android 1.5 and no longer maintained?
As you can see- I'm quite baffled here. Hope someone could clear this up for me.
I was with the exact same problem. The problem was that installing Wikitude from the market (following the link you provided) does not guarantee to have the system requirements supported in the virtual device, therefore it gives an error when you run the BasicOpenARDemo, if it let you install it at all.
The solution was creating an AVD with an GoogleAPI (it includes maps support, I used the level 10 API for Android 2.3.3, it didn't work for the level 8 API), adding the camera, accelerometer, compass, GPS, etc., support to the virtual device (I did this via Eclipse). Then I downloaded the .apk for Wikitude and installed it via command line (.adb).