genymotion ARM translation: "…/lib/arm/libndk.so" has unexpected e_machine: 40 - android-ndk

Here is full code, when I try android jni sample, I get has unexpected e_machine, the full steps are:
$ /media/roroco/disk750/adr/android-ndk-r10e/ndk-buil
in project, new android application, and run it
and get following output
Process: com.mamlambo.sample.ndk1, PID: 5560
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.mamlambo.sample.ndk1-1/lib/arm/libndk1.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:988)
at com.mamlambo.sample.ndk1.AndroidNDK1SampleActivity.<clinit>(AndroidNDK1SampleActivity.java:35)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)

I find the solution, the reason is I use genymotion and install genymotion armtranslation, the armtranslation has bug, so I should build c to x86 device, the steps are:
create jni/Application.mk, write "APP_ABI := x86 armeabi armeabi-v7a"
ndk-build
debug app in genymotion

Using Visual Studio for Mac i get a similar error when i build the release version of the app and run it on Genymotion with ARM translation. java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/<appname>/lib/arm/libmonodroid.so" has unexpected e_machine: 40
I solved the issue by following steps :
Right click the project name
Choose Options
Choose Build
Choose Android Build
Change the Configuration to Release(Active)
Go to the Advanced tab and add the x86 under Supported ABIs

Related

Why can I run a simple counter application through an android simulator but not through an ios simulator?

I am trying to run a sample application that creates a counter on both an android simulator and an ios simulator. The android simulator is created through android studio and the ios simulator is created through xcode. The application works well on the android simulator, but not on the ios simulator when following the same steps. Any ideas on how to fix this?
This is what the return is:
Launching lib/main.dart on iPhone 11 in debug mode...
Running Xcode build...
Xcode build done. 10.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11.
Type in your shell open ios/Runner.xcodeproj the on XCode go to Runner -> Targets Runner -> All
And check you have a Team selected and also if it's a physical device you granted the permission on the iPhone.
Steps: https://i.stack.imgur.com/Qeh7p.png

Can't connect any virtual device to android studio

I am trying to set up my android studio to connect or read the virtual device i fail every time !
i tried to download (intel X86 emulator accelerator (HAXM installer) ) but the download every time does not completed successfully with a message ( please file a bug to intel )!!!!
when i'm trying to run the app from the cmd it gives me a message that (No supported devices connected.)
when even the virtual machine is running and i click run to RUN my App it gives me that error :
'Dart' is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Exception: Gradle task assembleDebug failed with exit code 1
Did you open the virtual device and opened flutter console and entered "flutter run" oh android studio also works
I had a similar error: "Could not find or load main class org.gradle.wrapper.GradleWrapperMain Exception: Gradle task assembleDebug failed with exit code 1"
Try flutter doctor in the flutter console and run flutter pub get on your project
Note: I'm not the best at this stuff
Edit:
Using a physical device is probably better...
Virtual devices are extremely laggy for me (windows 10) and it's just hard in general.
Edit 2: (important)
Did you install the flutter plugin?
Did you do:
File>New>New flutter project>Select flutter application?
This is what solved it for me

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

Android NDK application stops unexpectedly

I am using android studio. I have downloaded and installed Android NDK by following the instructions given in this link.
The application runs on the emulator perfectly. I have downloaded the strace for android from here.
The problem is that when I give the path of Android.mk file in the ndk build and then Synchronize, Build and Run the application it shows notification that "Application is stopped".
This happens both on the device and emulator.
Any advice on how to resolve this?

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

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.

Resources