LLVM: commnad not found llvm-readobj - android

While trying to build sample qt app for android, stuck with below errors.
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readobj
Command does not exist:
/Users/sungyong/Library/Android/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip
11:26:20: The process
"/Users/sungyong/Qt/5.12.2/android_arm64_v8a/bin/androiddeployqt"
exited with code 9. Error while building/deploying project qtempty
(kit: Android for arm64-v8a (Clang Qt 5.12.2 for Android ARM64-v8a))
When executing step "Build Android APK"
Even though googling correct solution, still have no idea.
What do I check?
There's is no 'llvm-readobj' at this path even though I follow guide.

I've also encountered a similar problem.
The error message was llvm-strip:not found, despite having clang-10 on my Ubuntu system.
But I found llvm-strip-10 in directory /usr/bin, it's not llvm-strip.
So I made soft link llvm-strip --> llvm-strip-10 and it works.

Presumably you need to update your NDK. It's there in a current release.

Related

Android aapt2 tool fails with "failed to open file: The device does not recognize the command"?

as part of a custom Android build chain, I am calling "aapt2 link" in order to link the files generated by a previous call to "aapt2 compile" together. This works fine on Mac, but on Windows it fails with the following error:
failed to open file: The device does not recognize the command.
I'm using the same SDK versions, and the error happens on multiple systems, including my own those of users of our build chain.
I'm calling rapt as follows:
C:\Users\mh\AppData\Local\Android\sdk\build-tools\33.0.1\aapt2.exe
link
-v
-o c:\obj\destination.apk
--manifest c:\Obj\manifest.xml
--java c:\Obj\java
-I C:\obj\android.jar
--proto-format
--min-sdk-version 26
--target-sdk-version 26
#c:\Obj\Aapt2LinkFiles.txt
(paths shortened for clarity here). All files listed in c:\Obj\Aapt2LinkFiles.txt exist, and aapt prints them all out, before emitting the error.
Does anyone have an idea what I could be missing?
As a side question: Is there a way to see, in Android Studio, how and with what parameters aapt2 is called as part of the normal automated build process? Because builds in Android Studio work fine (but I seem to not be able tom find any lace where there is a full build log, in the way that other IDEs such as Xcode or Visual Studio provide a textual overview of what actual tools get executed and with what parameters, as you build.
Thanx!
Update full command line for repro:
C:> C:\Users\mh\AppData\Local\Android\sdk\build-tools\33.0.1\aapt2.exe link -v -o c:\Obj\ForAAB.apk --manifest c:\Obj\m.xml --java c:\Obj\java -I C:\obj\a.jar --proto-format --min-sdk-version 26 --target-sdk-version 26 #c:\Obj\files.txt
Output
note: including C:\obj\a.jar.
note: linking package 'org.me.testapt2' using package ID 7f.
c:\Obj\res-aapt2\drawable-hdpi_icon.png.flat
c:\Obj\res-aapt2\drawable-ldpi_icon.png.flat
c:\Obj\res-aapt2\drawable-mdpi_icon.png.flat
c:\Obj\res-aapt2\drawable-xhdpi_icon.png.flat
c:\Obj\res-aapt2\drawable_icon.png.flat
c:\Obj\res-aapt2\layout_main.xml.flat: error: failed to open file: The device does not recognize the command. (22).
error: failed parsing input.
files can be found at https://www.dropbox.com/s/zuuopmhyzkd271u/Obj.zip?dl=0, unzip to C:\Obj

Can we debug the APK with ASAN active on Android Studio?

My project is a simple game with native C++ code and Java, which uses cmake to compile C/C++ code. I'm using address sanitizer to check my the code. I follow the instruction here
My OS is windows 10 64bit.
However, when I press debug on Android Studio, I got the message as
2020-03-19 13:50:56.946 5152-5152/? E/logwrapper: executing /data/app/com.indie.haiphan.Breakout-ZFFz_f8ETleajrgP6rg9gw==/lib/arm64/wrap.sh failed: No such file or directory
2020-03-19 13:50:56.946 5151-5151/? I/wrap.sh: executing /data/app/com.indie.haiphan.Breakout-ZFFz_f8ETleajrgP6rg9gw==/lib/arm64/wrap.sh failed: No such file or directory
2020-03-19 13:50:56.956 5151-5151/? I/wrap.sh: wrap.sh terminated by exit(255)
2020-03-19 13:50:56.957 873-873/? W/Zygote: Error reading pid from wrapped process, child may have died
I checked on my APK (with Analyze APK of Android Studio) the wrap.sh exist.
So my question is I can't debug with wrap.sh inside the APK?
Thanks
You probably have BOM or an extra carriage return at the end of the first line of your wrap.sh. Which is possible in windows.
To fix it you can use dos2unix tool.
See this: https://unix.stackexchange.com/a/27067/197738

stuck on creating 'moor_database.g.dart'

I wanted to generate file 'moor_database.g.dart' by typing the command 'flutter packages pub run build_runner watch' but after doing some procedures it just tells: [INFO] Succeeded after 9.0s with 0 outputs (4 actions)
And inside the terminal results I saw this warning:
[WARNING] moor_generator:moor_generator on lib/data/moor.dart: Missing "part 'moor.g.dart';".
I had this message because I had my own file called moor.dart which conflicted with the moor library file (that's why that command was not working properly) but Android Studio didn't give any direct errors or warning on that, after renaming my file name, everything worked

java.lang.IllegalArgumentException: Error: Failed to parse APK file:

I have search stockoverflow and google with no luck. I recently migrated my app to androidx, after a lot of effort I was able to fix all the build fails. but now I am getting the following error when the app is installing on the emulator or the device. any help will be highly appreciated.
I have tried the following:
invalidate caches/restart
clean build and rebuild project
uninstalled app from the device
restarted my pc
Exception occurred while executing:
java.lang.IllegalArgumentException: Error: Failed to parse APK file: /data/local/tmp/...
at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:338)
at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:906)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21328)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2821)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3856)
at android.os.Binder.execTransact(Binder.java:731)
Caused by: android.content.pm.PackageParser$PackageParserException: Failed to parse /data/local/tmp/...
at android.content.pm.PackageParser.parseApkLiteInner(PackageParser.java:1590)
at android.content.pm.PackageParser.parseApkLite(PackageParser.java:1575)
at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:331)
... 9 more
$ adb shell pm uninstall ...
Unknown failure (at android.os.Binder.execTransact(Binder.java:731))
Error while Installing APK
Delete the previous app-release.apk file from the android folder:
\app\build\outputs\apk\release
Then clear all data from the emulator. Finally, rebuild the application.
Clean -> Rebuild -> and try to check both v1 and v2 while generating apk file
You should drop the cache on your mobile.
for example:
1- open your windows terminal on your computer
2 - enter the command >adb shell
you should be insite on your mobile
3 - enter to the tmp/appium_cache/ folder with >cd data/local/tmp/appium_cache
4 - write the command >ls to see all the elements that there is insite of that folder
5 - drop all that elements with the command >rm filename
hope to help you
just delete build folder and run again
android/app/build

Jenkins-CI SCP Plugin cannot find files to upload

I have Jenkins-CI compiling an Android app I'm working on. Compiles it great but it will not upload the release apk via SCP. I have set the source to bin/* and it gives me the following error. Does anyone have a suggestion on what I have configured wrong? I've had it working in the past, but I forgot to get the config before I re-installed Fedora on the machine.
[SCP] Connecting to smccloud.com
ERROR: Failed to upload files
2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1741)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1758)
at com.jcraft.jsch.ChannelSftp.stat(ChannelSftp.java:1715)
at be.certipost.hudson.plugin.SCPSite.upload(SCPSite.java:188)
at be.certipost.hudson.plugin.SCPRepositoryPublisher.perform(SCPRepositoryPublisher.java:218)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635)
at hudson.model.Build$RunnerImpl.post2(Build.java:161)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604)
at hudson.model.Run.run(Run.java:1400)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Build step 'Publish artifacts to SCP Repository' changed build result to UNSTABLE
I encountered this error when I was trying to copy to a directory that didn't exist on the target machine. Create the directory(s) on the target first and this should go away and the copy work.
On the target machine you are seeing something like:
No such file or directory
when you try to navigate to the non-existent directory.
If the plugin isn't working for you can use the shell script with expect, as a post build step, to do it for you.

Categories

Resources