rive-app/rive-ios

Fatal error: failed to locate filename in bundle

Closed this issue · 6 comments

Description

Hey, so I'm making an app in swiftUI for my final project. I wanted to add some custom animated icons (using rive), but it is not working. I've made a complete new project and for some reason, it works there. Since I made some connections to services like firebase, I don't want to copy/paste it the the new project.
The problem is the following:

  • Whenever I want to create a RiveViewModel(), whether it would be in the contentview or some other view, I keep getting the error message: "RiveRuntime/RiveFile+Extensions.swift:19: Fatal error: Failed to locate house in bundle."

I have tried putting the .riv files in different folders, seperate,...

Source .riv/.rev file

I have tried different .riv files, but here are some basis files that didnt' work.

Expected behavior

Hopefully someone can help me with this error, since Rive animations looks pretty promising.

Screenshots

<-- If applicable, add screenshots to help explain your problem. -->

Screenshot 2022-12-21 at 09 45 54

Screenshot 2022-12-21 at 09 46 13
Screenshot 2022-12-21 at 09 46 46
Screenshot 2022-12-21 at 09 46 59
Screenshot 2022-12-21 at 09 47 22
house.riv.zip

Device & Versions (please complete the following information)

  • Device: iOS Simulator: Iphone 14 Pro
  • iOS version 16.0
  • XCode version: 14.2

Additional context

The only other package that I'm using is Firebase, but that can't cause the problem.

I have the same problem

@mjtalbot any suggestions?

I am experiencing the same problem as well

@damondeletter, @nickfrazier27 for each of your '.riv' files in the Rive folder, set each file's Target membership to point to your app (iOS-app-gym)
You can access Target membership by selecting a file and opening File Inspector, at the bottom of the file inspector menu, find Target Membership.
If you select '.riv' file within the Rive folder and do not see the Target membership in the file inspector menu, then drag and drop the '.riv' file out of the Rive folder

Hi @damondeletter, @Kaid00 is correct, this is very likely because the files are not added to the "bundle resources".

There is some documentation on this by apple. There are also quite a few stackoverflows that should help with this.

Closing this for now, but if this does not solve the problem please feel free to re-open the issue

I faced this same problem, and the issue was that the file had no extension. Make sure your file has the .riv extension, and in the code you can call it without the .riv extension, e.g. RiveViewModel(fileName: "unlock")