Flutter libe36b.so: File format not recognized - android

I am having some difficulties with this during my build on Flutter Android:
flutter build appbundle
Building with sound null safety
aar: [com.deepar.ar, deepar2, 1.0.2] file sha1:fdf11bded5de3b90c7ca656fabd3fbd82980cecd md5:94e94dcb7a3e9cbf282c3ecb3de3d88b
D:\Platforms\AndroidSDK\ndk\20.0.5594570\toolchains\llvm\prebuilt\windows-x86_64\bin\x86_64-linux-android-objcopy:D:\Development\SimWave\paige\build\app\intermediates\merged_native_libs\release\out\lib\x86_64\libe36b.so: File format not recognized
D:\Platforms\AndroidSDK\ndk\20.0.5594570\toolchains\llvm\prebuilt\windows-x86_64\bin\i686-linux-android-objcopy:D:\Development\SimWave\paige\build\app\intermediates\merged_native_libs\release\out\lib\x86\libe36b.so: File format not recognized
D:\Platforms\AndroidSDK\ndk\20.0.5594570\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-objcopy:D:\Development\SimWave\paige\build\app\intermediates\merged_native_libs\release\out\lib\arm64-v8a\libe36b.so: File format not recognized
Running Gradle task 'bundleRelease'... 131.8s
√ Built build\app\outputs\bundle\release\app-release.aab (72.7MB).
Anyone has some fix for this?
I tried switching to an older NDK version for Android Studio but with older NDK version it does not work.

Related

NDK build issue: aarch64-linux-android-ar.exe xxx.cpp.o: No such file or directory

Background: I'm building a gradle project with linked C++ project (external native build).
In that procedure, an unexpected error happened:
D:\jenkins_node\workspace\new_build_android2\new_android_build_test\android-ndk-r20\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar.exe: sandbox/3rd/Bullet/src/BulletCollision/CMakeFiles/BulletCollision.dir/CollisionDispatch/btActivatingCollisionAlgorithm.cpp.o: No such file or directory
Then I reproduced this error in command line on the same machine:
D:\jenkins_node\workspace\new_build_android2\new_android_build_test\engine\projects\android\.externalNativeBuild\cmake\release\arm64-v8a>D:\jenkins_node\workspace\new_build_android2\new_android_build_test\android-ndk-r20\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar.exe qc .\sandbox\3rd\Bullet\src\BulletCollision\libBulletCollision.a #CMakeFiles/BulletCollision.rsp
The content of #CMakeFiles/BulletCollision.rsp is https://gist.github.com/zwcloud/4897dde48194e5324c899f17a3356be6 , which contains:
sandbox/3rd/Bullet/src/BulletCollision/CMakeFiles/BulletCollision.dir/CollisionDispatch/btActivatingCollisionAlgorithm.cpp.o
The file btActivatingCollisionAlgorithm.cpp.o does exist:
What's the possible reason why aarch64-linux-android-ar.exe reports the error that btActivatingCollisionAlgorithm.cpp.o doesn't exist? And how to fix this?
UPDATE:
I just tried
D:\jenkins_node\workspace\new_build_android2\new_android_build_test\android-ndk-r20\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar.exe qc sandbox\3rd\Bullet\src\BulletCollision\libBulletCollision.a sandbox/3rd/Bullet/src/BulletCollision/CMakeFiles/BulletCollision.dir/CollisionDispatch/btActivatingCollisionAlgorithm.cpp.o
And it still reported the same error:
D:\jenkins_node\workspace\new_build_android2\new_android_build_test\android-ndk-r20\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar.exe: sandbox/3rd/Bullet/src/BulletCollision/CMakeFiles/BulletCollision.dir/CollisionDispatch/btActivatingCollisionAlgorithm.cpp.o: No such file or directory
Environment: Win10, CMake 3.10 (downloaded by Android Studio 3.5 in Settings -> SDK Tools), Android NDK r20

Unity says resource style/Theme.AppCompat.Light.NoActionBar not found

I have a Unity project which, when compiled via Unity's Gradle build option, fails with
Output: error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.xxx.sdk.unity:style/Theme.AppCompat.Light.NoActionBar) not found.
error: failed linking references.
I can reproduce this same error by entering a terminal, and going into the Temp/gradleOut directory, then saying gradle :MySDK:verifyReleaseResources or gradle :MySDK:assemble. However, if I change it to gradle :assemble then it works fine (this is what Android Studio does when I open the same Temp/gradleOut directory and it builds and runs the app fine):
/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle/bin/gradle :assemble
> Configure project :
> Configure project :MySDK
BUILD SUCCESSFUL in 17s
Is there a way to make Unity3d (2017.2.0f3 in my case as the latest version crashes on Linux) execute the same gradle task as Android Studio? So instead of trying to do :MySDK:whatever it would do :whatever?
Ciao,
try adding .aar files in Assets/Plugins/Android folder.
Something when you build your app for Android, look for that resource (are you using Facebook SDK for example ?) and when building android app Unity need to find that resources in android archives.
This is my configuration :

ndk-build.cmd isn't recognized as internal or external command

I'm working on OpenCV library in android studio.I'm using 2.2.1 version of android studio. Problem is that when I run ndk-build.cmd on command prompt, debugger shows that it is not recognised command,operable program or batch file.
when I build my project it gives error, that is:
" Error:(120) *** Android NDK: Aborting. Stop."
I also have tried to build project without importing OpenCV library as I was following a tutorial, but it also give error.
"Error:Execution failed for task ':app:compileDebugNdk'.
Error: Your project contains C++ files but it is not using a supported native build system.
Consider using CMake or ndk-build integration with the stable Android Gradle plugin:
https://developer.android.com/studio/projects/add-native-code.html
or use the experimental plugin:
http://tools.android.com/tech-docs/new-build-system/gradle-experimental."
Even I download CMake and NDK tools but still this error exists. Please guide me to solve this problem.
Thanks in advance.
To run ndk-build
1)you have to add its path in your Enviroment Variable so yo can access it from anywhere with just "ndk-build.cmd"
or
2) you have to give full ndk path like E:\sdk\ndk-bundle\ndk-build.cmd if you have windows
To run ndk-build from command prompt, you can provide the full path to the script, e.g.
C:\> d:\android\ndk\ndk-build.cmd
It is important to install ndk to a directory with no spaces in its full path, e.g.
d:\android SDK\ndk r13
won't work. Avoid spaces in the path to your project, too. Android Studio will not be happy to build
e:\my projects\android apps\ndk sample\build\outputs\apk\my first ndk app.apk

Android Studio, CMake. How to print debug message in compile time?

I'm using Android Studio 2.3 beta 3. I put message(AUTHOR_WARNING "Hello CMake, hello Android") In my CMakeLists.txt
But I saw this message only few times when rebuilding project in Android Studio. In most cases there's no "Hello CMake, hello Android" string in Gradle Console after build finishes. I've tried resync gradle and clean/rebuild project, still no expected output.
I have some problems with my build (I think it's incorrect paths) so my goal - to print CMake variables in compile time to better understand what is actually going on.
Inside the project tree, you can find the log with all the cmake output inside the folder of each generated architecture. The relative path to the file should be something like:
[project folder]/app/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_build_output.txt
Here you can see all the MESSAGE calls of the cmake scripts.
my android studio cmake output:
compile detail:
.cxx/cmake/debug/arm64-v8a/compile_commands.json
cmake output:
.cxx/cmake/debug/arm64-v8a/build_output.txt
CMake messages are only at generation time (when CMake is used to generate your project / Makefile).
One way to get CMake to generate is to go to retrieve the build folder and the CMakeCache.txt file in it, and then:
Retrieve the path to your cmake executable, by reading the CMakeCache.txt file and checking the value of the CMAKE_COMMAND variable
Open a command prompt in CMakeCache.txt directory
Run: <path_to_cmake_found_at_point_1> .
Note: The build folder should have a CMakeCache.txt file. The above will not work unless it does.
On my rig I found the logs in <module name>/build/intermediates/cxx/<cmake build type>/<hash>/meta/<ABI>/cmake_server_log.txt -- C++ programming for Android just keeps getting more convenient all the time :\
My rig:
Android Studio Arctic Fox 2020.3.1 Patch 3
AGP 7.0.2
Gradle 7.2.0
NDK 21.4.7075529
CMake 3.10.2
Windows 10 (hopefully host OS doesn't matter)

Android - Phonegap - Conversion to Dalvik format failed with error 1

I installed this:
https://github.com/mwbrooks/cordova-plugin-menu
and have cordova 1.8.1 installed.
I copied "libs/phonegap-1.0.0.jar" to ANDROID_PROJECT/libs.
When i try and run the app in the simulator, i get :
"Conversion to Dalvik format failed with error 1"
I believe this is to do with conflicts with libraries, but I don't know what to do to remove the error?
please help.
I have found myself in the same situation after upgrading from 2.0.0 to 2.1.0
First of all make sure you have reconfigured the build path by removing the JAR from the old PhoneGap version and adding the new one.
At this point I started getting the Dalvik error. Cleaning the build environment didn't help.
So I remove the old jar from the libs directory and voilá, it worked.
Project -> Turn off Build Automatically. Then Build project manually and clean. Then export signed project. Problem has been gone.

Categories

Resources