I got this error while trying to build my flutter application
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rive_common:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/android/.cxx/Debug/13194d4d/arm64-v8a'
[1/64] Building CXX object CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp.o
FAILED: CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp.o
/home/mcrops/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/home/mcrops/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Drive_text_EXPORTS -I../../../../../ios/harfbuzz/src -I../../../../../ios/rive-cpp/skia/renderer/include -I../../../../../ios/rive-cpp/include -I../../../../../ios/SheenBidi/Headers -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -DWITH_RIVE_TEXT -DHAVE_OT -DHB_NO_FALLBACK_SHAPE -DHB_NO_WIN1256 -std=c++11 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp.o -MF CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp.o.d -o CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp.o -c /home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp
In file included from /home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/rive_counter.cpp:5:
In file included from ../../../../../ios/rive-cpp/include/rive/rive_counter.hpp:8:
In file included from ../../../../../ios/rive-cpp/include/rive/rive_types.hpp:12:
/snap/flutter/current/usr/include/c++/9/memory:121:25: error: cast from pointer to smaller type 'uintptr_t' (aka 'unsigned int') loses information
const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[2/64] Building CXX object CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/text/line_breaker.cpp.o
FAILED: CMakeFiles/rive_text.dir/home/mcrops/.pub-cache/hosted/pub.dev/rive_common-0.2.7/ios/rive-cpp/src/text/line_breaker.cpp.o
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
Exception: Gradle task assembleDebug failed with exit code 1
2
Answers
After long hours of debuging, I was able to solve the error by removing this package
awesome_dialog:
from my pubspec.yaml file. Am still not sure why it was causing the issueThis may be because of the conflict in the cache,
Trying doing this things,this will definitely resolve the problems: