I'm building c++ application for android using Android Studio 2.3.3. Build fails with error:
Fatal error: can't create
CMakeFiles/kore.dir/C_/ab/android-native-build/Sources/src/banan/server/serverData/ServerCompound_banan_server_serverdata_ListValue_IdInt_banan_server_serverdata_ServerCompound_serverdata_ServerAchieve.cpp.o:
No such file or directory clang++.exe: error: assembler command failed
with exit code 1 (use -v to see invocation)
The directory in which this file should be created exists and some other files were successfully created there.
I think this is because of path is too long. I've seen such messages previously and moving project to another directory with shorter path have solved the issue. But now I've already done this.
shorter your project location because path maximum 256 char long is accepted.
Related
I am trying to build my React Native Android app on Visual Studio App Center and I get this error:
Task : Shell script
Description : Run a shell script using Bash
Version : 2.165.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
[command]/bin/bash /Users/runner/runners/2.165.2/scripts/android-postprocess.sh /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk
Removing all ABI or density dependent APKs…
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
Found 0 APK file(s)
Found 0 unaligned APK file(s)
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 36: pushd: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk/..: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 43: popd: directory stack empty
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Android Postprocess
##[section]Starting: Post Build Script
It's incorrectly looking for my APK in the app/app/build/... instead of app/build/...So I want to copy the files to app/app/build/.. so it finds them there.
I can't copy the files with a post-build script because it runs after the script that throws the error.
Is it possible to somehow achieve copying with Gradle? Or maybe have multiple build paths? Or some other solution?
The problem was that I had gradlew, gradlew.bat and gradle folder in my appmodule folder. I must have mistakenly opened the app folder alone in Android Studio and synced the project.
I solved it by creating a fresh React Native project.
How to solve artoolkit nftBook issues in android studio
When I run the command ndk-build in android studio terminal for nft book it shows the error like:
clang++.exe: error: linker command failed with exit code 1 (use -v to
see invocation) make: *** [obj/local/armeabi/libnftBookNative.so]
Error 1
How can I solve this?
You should not run it in the android studio terminal but in the Git-Bash.
Read the documentation more closely :).
You look like you are working from Windows so you need to use Git-Bash for compilation.
See: http://artoolkit.org/community/forums/viewtopic.php?f=26&t=17092
===========
EDIT:
Make sure you have these environment variables set:
- Set ANDROID_HOME to indicate the path to root folder of the downloaded Android SDK.
Set ANDROID_NDK_ROOT to indicate the path to root folder (most likely, “ndk-bundle”) of the downloaded NDK. The ANDROID_HOME environment variable can be used to help define NDK.
ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
Set NDK to the same path as ANDROID_NDK_ROOT. NDK=$ANDROID_NDK_ROOT
Set PATH to include a path to the ndk-build[.cmd] script file, that is, the path to the root folder of the NDK. The NDK environment variable can be used to help define the added path.
Now start gitBash and navigate to your ARToolKit5_ROOT directory.
cd android
./build.sh
if successful
./build_native_examples.sh
I'm trying to rebuild Limbo Android. I'm on Linux Mint.
All I changed was android-config.mak NDK_ROOT, exported variables NDK_ROOT. I've also exported NDK_MODULE_PATH to /home/pathtoandroidndk/sources, as per README instructions.
From terminal I do cd limbo-android/jni and then make.
Building returns this error:
jni/glib/glib/./libcharset/localcharset.c:22:20: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs-debug/glib-2.0/./libcharset/localcharset.o] Error 1
make: Leaving directory `/home/me/limbo-android'
I've tried modifing Android.mk following instructions from Android NDK - Additional Include Directories and Unable to find header files - Android NDK, without success.
I came to conclusion that each module inside limbo-android needs it's own config.h file, while libcharset does not have one.
How do I solve this error? Is there a generic config.h (the one from NDK maybe?)
NOTE: I can build it without any problems on Windows 8.1 using mingw.
I am looking at the example application for the Qt Sensors that comes with qt and I've complied it on windows with no errors, but as soon as I try to put it onto my android I get this compile error.
10:41:51: Running steps for project qmlqtsensors...
10:41:51: Configuration unchanged, skipping qmake step.
10:41:51: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
10:41:52: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
10:41:52: Removing directory C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build
10:41:52: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build" install
copy /y "libqmlqtsensors.so" "C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\libs\armeabi-v7a\libqmlqtsensors.so"
1 file(s) copied.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
makefile:873: recipe for target 'install_app' failed
mingw32-make: *** [install_app] Error 1
10:41:53: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project qmlqtsensors (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Copy application data'
10:41:53: Elapsed time: 00:02.
I've looked on google with no avail. Can anyone help me with this problem please?
It seems the error or at least one of them is because the path to your file qmlqtsensors is too long.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
Try to compile and run your project at a different location with a shorter path.
I get the error on this example (and had the same on previous examples some while ago).
My problem turned out to be that when the Makefile is generated, it generates 'wrong' code. It generates stuff like:
mkdir C:$(INSTALL_ROOT)/........
which is fine if $(INSTALL_ROOT) evaluates to a relative path but in fact it resolved to an absolute path, that is:
mkdir C:C:/Qt/.......
So simply edited the Makefile replacing all occurrences of 'C:$(INSTALL_ROOT)' with '$(INSTALL_ROOT)'. It worked for me and hopefully you too.
I'm having a hard time setting up PowerVR SDK for Android on Windows 8 64, assuming I met all requirements:
Android SDK (fresh Eclipse)
Android NDK
Cygwin (with make)
PowerVR Android SDK 3.0
I can perfectly make and run an Android NDK sample. However, the same process fails for building any PowerVR sample (from the SDK). Here's the output when I try to run the makefile:
$ ndk
Compile++ thumb : OGLES2Texturing <= OGLES2Texturing.cpp
arm-linux-androideabi-g++.exe: error: C:/cygwin///cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.cpp: No such file or directory
arm-linux-androideabi-g++.exe: fatal error: no input files
compilation terminated.
/cygdrive/c/android-ndk-r8d/build/core/build-binary.mk:269: recipe for target `obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o' failed
make: * [obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o] Error 1
I suppose the error should be related to a wrong path given to the compiler. To me it looks like a mixture of standard Windows and Cygwin/Unix paths: * C:/cygwin///cygdrive/c/Users/stfn/...*
If been through so many makefiles now trying to resolve this issue but I just don't know where else to look. This is the first time I tried messing with the NDK. I'm afraid this could be my last.
Any help would be greatly appreciated
1.in the Android.mk file, for the PVRSDKDIR, set the path of your project folder in your workspace.
2.Copy the build, tools, and shell folders from the powervr sdk folder to your project folder