Closed deezee30 closed 10 months ago
Hi @deezee30, what OS are you running? Are you only experiencing this when bundling or with normal flutter run
for Android as well?
Could you also give me the output for clang --version
@HayesGordon Thanks for looking into this.
I'm running Ubuntu 23.04, but this was also tested on Ubuntu 22.04. Yes, flutter run
also causes an error. I'm not sure if it's the exact same but it does not compile and references rive_common
.
clang --version
output:
Ubuntu clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
There may be something in this issue thread of help, see here: https://github.com/rive-app/rive-flutter/issues/291#issuecomment-1541877204
Updating your gradle dependency might be what is needed. What is it currently set to?
Could you confirm if this problem occurs in a new Flutter project as well, after running flutter create
and then adding Rive.
Though it seems like your Cmake and Clang are up to date.
You could also try running: flutter clean
And open the Android folder in Android Studio and go to Build -> Clean Project
My Gradle version is 7.3.1, so it should be okay. I tried updating it to 8.0.0 (latest stable release) but it's not fully supported by some of the tools I use yet so I wasn't able to test out if it works with 8.0.0. Nonetheless, 7.3.1 is higher than what that fix requires.
I've tried cleaning Android project and running flutter clean
with no success.
I've also tried this on a fresh project as got a similar compilation error but not quite the same. Here is the comparison between the two errors for clarity: https://www.diffchecker.com/skFLGGdb/ Left side is the original error, right side is the fresh error.
Same error here Flutter 3.10.1 Rive 0.11.2
Same error here Flutter 3.10.5 Rive 0.11.3
CompileC /Users/runner/Library/Developer/Xcode/DerivedData/Runner-bomutmstgikhmkcxiajovabpilhs/Build/Intermediates.noindex/Pods.build/Release-iphoneos/rive_common.build/Objects-normal/arm64/font_hb.o /Users/runner/.pub-cache/hosted/pub.dev/rive_common-0.0.10/ios/rive-cpp/src/text/font_hb.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'rive_common' from project 'Pods')
Same error here Flutter 3.10.5
C:....\windows\flutter\ephemeral.plugin_symlinks\rive_common\windows..\ios\rive-cpp\include\rive/math/mat2 d.hpp(17,5): error : definition of implicit copy assignment operator for 'Mat2D' is deprecated because it has a user-decl ared copy constructor [-Werror,-Wdeprecated-copy] [C:....\build\windows\plugins\rive_common\rive_common_plug in.vcxproj]
I'm facing the same issue. Any solution so far? Flutter 3.10.5 Gradle 7.3.3 NDK: 25.1.8937393
I have the same issue Flutter 3.10.5 Gradle 7.3.3 Rive 0.11.3
I've got the same issue. Ubuntu 22.04 Rive 0.11.3 Bump
Any workaround??
same problem
@deezee30 managed to fixed it, I'm not sure what was the exact problem but I noticed that you also have flutter installed by snap, I uninstalled flutter and installed it manually, along with its dependencies and it worked ok.
Flutter installed via snap has issues building native plugins. See other reports here:
https://github.com/flutter/flutter/issues/106102 https://github.com/canonical/flutter-snap/issues/83
The solution, like @MaoHolden suggested, is to not install Flutter via Snap but to install it manually (clone from GitHub and add to Path). More instructions here: https://docs.flutter.dev/get-started/install/linux#install-flutter-manually
Same error here Flutter 3.10.5
C:....\windows\flutter\ephemeral.plugin_symlinks\rive_common\windows..\ios\rive-cpp\include\rive/math/mat2 d.hpp(17,5): error : definition of implicit copy assignment operator for 'Mat2D' is deprecated because it has a user-decl ared copy constructor [-Werror,-Wdeprecated-copy] [C:....\build\windows\plugins\rive_common\rive_common_plug in.vcxproj]
This looks like a different issue @absalam48. Could you open a separate issue with details regarding Windows version for this one?
I had the error for a week, impossible to go to Gradle 8 because of other packages. I was blocked not to be able to build my application for Android.
Flutter installed via snap has issues building native plugins. See other reports here:
flutter/flutter#106102 canonical/flutter-snap#83
The solution, like @MaoHolden suggested, is to not install Flutter via Snap but to install it manually (clone from GitHub and add to Path). More instructions here: https://docs.flutter.dev/get-started/install/linux#install-flutter-manually
By following the answer there, I uninstall the version of Flutter installed via Snap and now it works! Thanks @luigi-rosso !!
Any workaround??
This error was solved magically the next day, I don't know what cause it or how it got fixed I suspect something around the fvm cause that's the only thing that change over the week but I couldn't reproduce it anymore
I'm on macOS version: 13.4.1 (22F82) flutter version: 3.10.2 rive version: 0.11.5
Same error on my Ubuntu laptop.
I also installed Flutter using snap.
Few details
Builds well for
Build failed for Android. The build error message also contain some IOS references.
I already tried to clear pub cache using flutter pub cache clean
or change flutter version. Unfortunatelly, nothing works.
Same kind of error message than in the original comment of @deezee30
1 error generated.
[10/64] Building CXX object CMakeFiles/rive_text.dir/home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc.o
FAILED: CMakeFiles/rive_text.dir/home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc.o
/home/piotr/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/home/piotr/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/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc.o -MF CMakeFiles/rive_text.dir/home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc.o.d -o CMakeFiles/rive_text.dir/home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc.o -c /home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc
In file included from /home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/ios/harfbuzz/src/hb-aat-layout.cc:28:
In file included from ../../../../../ios/harfbuzz/src/hb.hh:475:
In file included from ../../../../../ios/harfbuzz/src/hb-meta.hh:32:
/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.
ninja: build stopped: subcommand failed.
C++ build system [build] failed while executing:
/home/piotr/Android/Sdk/cmake/3.18.1/bin/ninja \
-C \
/home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/android/.cxx/Debug/c4d5u2p3/arm64-v8a \
rive_text
from /home/piotr/.pub-cache/hosted/pub.dev/rive_common-0.2.3/android
* 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 8s
For anyone still stuck on this, uninstalling Flutter via snap and then installing it organically fixed my issue, as others have pointed out.
and if we use windows ? how to uninstall it ? is this the only solution ?
The windows issues mentioned here seem to be the same as this: https://github.com/rive-app/rive-flutter/issues/340
Which is as a result of using the latest version of Clang
Closing this issue as the resolution for this specific problem is to make sure you install Flutter via git and not via snap.
Just a confirmation that the cause was that I installed Flutter with snap.
Thanks for confirming @AhmedEzio47
Just a confirmation that the cause was that I installed Flutter with snap.
Same here, confirming x)
For anyone still stuck on this, uninstalling Flutter via snap and then installing it organically fixed my issue, as others have pointed out.
Thank you. After a miserable time trying to debug, this finally helped me solve it.
Hello @luigi-rosso , we cannot stop using a snap version of flutter due to company policies, do you think there is something that we could do on this side to fix the issue?
Description
Flutter app does not compile with latest Rive and results in an error coming from
rive_common
package. The following is the build log outputted by Flutter, with the error:Steps To Reproduce
Call the following command:
Source
.riv
/.rev
fileThis issue is not caused by any specific Rive asset.
Expected behavior
App launches as expected.
Screenshots
Not required.
Device & Versions (please complete the following information)
rive
version:0.11.2
25.1.8937393
Additional context
Not required.