tvm
tvm copied to clipboard
[Bug] Can not build the apk of "android_camera" in apps
The Bug.
Hi, I am trying to build "android_camera" on my laptop and install it on google pixel 2.
But after building the tvm4j and installing Gradle and other tools, it fails to build the demo.
https://github.com/apache/tvm/tree/main/apps/android_camera
After inputting gradle clean build, it shows this result.
> Task :app:buildJni FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:buildJni'.
> A problem occurred starting process 'command 'ndk-build''
I realize that maybe the path is not right. So I input gradle clean build --stacktrace.
The result is
Caused by: java.io.IOException: Cannot run program "ndk-build" (in directory "/home/timmy/Documents/research/tvm/apps/android_camera/app"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
That is weird because the path is correct. However, I try to manually execute the ndk-build command. Other wrong results shows up and it is unable to build.
Environment
gradle --version 7.5 ndk --version r25
Would you please take a look at this and find out what is the problem of this app, please? @argrento@yagnasrinath
Other wrong results shows up and it is unable to build.
Can you post them here too?
It seems that gradle can not execute ndk-build. Did you set up PATH and TVM_NDK_CC correctly?
Yes, I have set the right ndk path and I could use ndk-build in my command line. But this tutorial seems too old and has many mistakes. I modified a lot and could run the android demo. I may create a issue about this these days
Other wrong results shows up and it is unable to build.
Can you post them here too?
It seems that
gradlecan not executendk-build. Did you set upPATHandTVM_NDK_CCcorrectly?
Hi, sorry for the late reply. I have found something wrong with this app. https://github.com/apache/tvm/blob/main/apps/android_camera/dev_tools/sign_apk.sh#:~:text=%24CURR_DIR/-,tv8mdemo,-.keystore%20%2Dsignedjar%20%24SIGNED_APK You could see in this file, the generated rpk file name is wrong. It shoudl be tvmdemo.keystore(same with tutorial), insted of tv8mdemo.keystore.
Also, I find that the generated apk file should use zipalign -4 to make it installable. I do not know why but this makes it works. Could you tell me is there any resources to learn to write android app of tvm besides these three demos, thanks.