rive-flutter icon indicating copy to clipboard operation
rive-flutter copied to clipboard

rive_native: 0.1.0 hash verification failure

Open jakeaaron opened this issue 11 months ago • 25 comments

Description

Android app is failing to build with hash verification failure happening in 0.1.0 rive_native setup.sh.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add rive 0.14.0 to Flutter app
  2. Build for Android
  3. See build error

Expected behavior

Hash verification works correctly and native libs are installed and app runs.

[rive_native]   Initializing Rive Native for TargetPlatform.android. This may take some time the first time it is run.
[rive_native]   Downloading "android" libraries for version "0.1.0+1"
[rive_native]   URL: https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip
[rive_native]   Exception: Hash verification failed. Exiting script.
[rive_native]   #0      RiveSetup._downloadBinaries (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:492:7)
<asynchronous suspension>
#1      RiveSetup.init (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:178:9)
<asynchronous suspension>
#2      main (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:105:5)
<asynchronous suspension>

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

I just tried and it's working for me. I believe the download failed for you, as it's missing some of the logs - and looks like we're not logging if the download failed! So I can get that part patched up.

What it's supposed to look like:

[rive_native]   Starting Rive Native Setup...

[rive_native]   Building rive_native with assumed project root in:
[rive_native]   /Users/gordon/Documents/tmp/rive-0.14.0/example/stupidtest/

[rive_native]   Using package:rive_native from /Users/gordon/.pub-cache/hosted/pub.dev/rive_native-0.1.0
[rive_native]   Found Flutter app root at: /Users/gordon/Documents/tmp/rive-0.14.0/example/stupidtest
[rive_native]   Initializing Rive Native for TargetPlatform.android. This may take some time the first time it is run.
[rive_native]   Downloading "android" libraries for version "0.1.0+1"
[rive_native]   URL: https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip
[rive_native]   Downloaded and unzipped "android" libraries for version "0.1.0+1"
[rive_native]   Creating build directory: /Users/gordon/Documents/tmp/rive-0.14.0/example/stupidtest/build/rive_native/native/build
[rive_native]   Setup complete. You can now use Rive Native in your project.

Can you run:

dart run rive_native:setup --verbose --clean --platform android

And paste the output here.

HayesGordon avatar Dec 11 '25 18:12 HayesGordon

dart run rive_native:setup --verbose --clean --platform android
Resolving dependencies in `/Users/jacoballenwood/youversion/youversion-flutter`... 
Downloading packages... 
Got dependencies in `/Users/jacoballenwood/youversion/youversion-flutter`.
Building package executable... 
Built rive_native:setup.
[rive_native]   Starting Rive Native Setup...

[rive_native]   Building rive_native with assumed project root in:
[rive_native]   /Users/jacoballenwood/youversion/youversion-flutter/

[rive_native]   Using package:rive_native from /Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0
[rive_native]   Found Flutter app root at: /Users/jacoballenwood/youversion/youversion-flutter
[rive_native]   Cleaning rive_native android
[rive_native]   Initializing Rive Native for TargetPlatform.android. This may take some time the first time it is run.
[rive_native]   Downloading "android" libraries for version "0.1.0+1"
[rive_native]   URL: https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip
[rive_native]   Exception: Hash verification failed. Exiting script.
[rive_native]   #0      RiveSetup._downloadBinaries (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:492:7)
<asynchronous suspension>
#1      RiveSetup.init (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:178:9)
<asynchronous suspension>
#2      main (file:///Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0/bin/setup.dart:105:5)
<asynchronous suspension>

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

Does the machine you're running this on have any networking restrictions?

Are you able to download this zip from the same machine: https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip

HayesGordon avatar Dec 11 '25 18:12 HayesGordon

Yeah, I opened the link in the browser and it correctly downloaded the zip.

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

This also works from my terminal:

curl https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip --output "rivenative.zip"

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

I modified the setup.sh script to print the hashes:

computedhash: 78c749fc944964f265f2b03aa6db70a7ff805fb0acbadbf16eb96005e0370462264206edd2726c4f748352d1913e993f65eadec90647337dc7faf9bb1702af2a
expectedhash: 3c9f20149b34355259a39dbf3357190593e065e7c86cee9ef3511115841d325ef4a1d027ca60516d6f316ffc09061c561b32e0bdb41689448d4b2d4269691cdf

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

I'm running on mac, deploying to Android.

jakeaaron avatar Dec 11 '25 18:12 jakeaaron

Here's more info:

zip response status code: 200
zip body size: 10035102
zip file size: 10035102

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

I'm also on a mac.

Can you run:

curl https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip --output "rivenative.zip"
shasum -a 512 rivenative.zip

It should be 3c9f20149b34355259a39dbf3357190593e065e7c86cee9ef3511115841d325ef4a1d027ca60516d6f316ffc09061c561b32e0bdb41689448d4b2d4269691cdf

HayesGordon avatar Dec 11 '25 19:12 HayesGordon

I'm getting: 78c749fc944964f265f2b03aa6db70a7ff805fb0acbadbf16eb96005e0370462264206edd2726c4f748352d1913e993f65eadec90647337dc7faf9bb1702af2a

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Image

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Whoops, didn't mean to close this

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Could different mac versions somehow be producing a different sha?

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

ls -l rivenative.zip
wc -c rivenative.zip
shasum -a 512 rivenative.zip
-rw-r--r--@ 1 jacoballenwood  staff  10035102 Dec 11 13:09 rivenative.zip
 10035102 rivenative.zip
78c749fc944964f265f2b03aa6db70a7ff805fb0acbadbf16eb96005e0370462264206edd2726c4f748352d1913e993f65eadec90647337dc7faf9bb1702af2a  rivenative.zip

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Not to my knowledge. Can you upload the zip here and I can verify what hash I'm getting

HayesGordon avatar Dec 11 '25 19:12 HayesGordon

rivenative.zip

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

I'm going to try to hit it again while avoiding my work VPN, to see if that could be a problem

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Okay so I'm getting the same hash as you with that zip. It seems like in that zip there is an additional .DS_Store file

HayesGordon avatar Dec 11 '25 19:12 HayesGordon

I just disabled my VPN and now I'm getting: 3c9f20149b34355259a39dbf3357190593e065e7c86cee9ef3511115841d325ef4a1d027ca60516d6f316ffc09061c561b32e0bdb41689448d4b2d4269691cdf

jakeaaron avatar Dec 11 '25 19:12 jakeaaron

Now I'm seeing this:

[rive_native]   Starting Rive Native Setup...

[rive_native]   Workspace project root detected. Building rive_native with adjusted project root in:
[rive_native]   /Users/jacoballenwood/youversion/youversion-flutter/

[rive_native]   Using package:rive_native from /Users/jacoballenwood/.pub-cache/hosted/pub.dev/rive_native-0.1.0
[rive_native]   Found Flutter app root at: /Users/jacoballenwood/youversion/youversion-flutter
[rive_native]   Initializing Rive Native for TargetPlatform.android. This may take some time the first time it is run.
[rive_native]   Downloading "android" libraries for version "0.1.0+1"
[rive_native]   URL: https://rive-flutter-artifacts.rive.app/rive_native_versions/0.1.0%2B1/rive_native_artifacts_android.zip
zip response status code: 200
zip body size: 10050720
zip file size: 10050720
running unix shasum on filepath: /var/folders/m6/dl0zv12x1f1_xzlnhyx1g1_c0000gp/T/file.zip
[rive_native]   Downloaded and unzipped "android" libraries for version "0.1.0+1"
[rive_native]   Creating build directory: /Users/jacoballenwood/youversion/youversion-flutter/build/rive_native/native/build
[rive_native]   Setup complete. You can now use Rive Native in your project.
***** deleting assets *****

jakeaaron avatar Dec 11 '25 19:12 jakeaaron