rive-app / rive-android

A runtime for interactive animations on Android
https://rive.app
MIT License
332 stars 30 forks source link

No Artboard found. #309

Closed srdrakcay closed 6 months ago

srdrakcay commented 7 months ago

I'm getting this error for our own animations.When I use the sample animations url from the documentation its work fine. What could be issues for the animations ?

--Here my sample code ;

private fun setAnimations(url: String) {
        lifecycleScope.launch {
            try {
                val bytes: ByteArray = withContext(Dispatchers.IO) {
                    URL(url).openStream().use { it.readBytes() }
                }
               Rive.init(requireContext())
                binding.animationsView.setRiveBytes(bytes, fit = Fit.FIT_HEIGHT)
                delay(5000)
                binding.animationsView.stop()
                binding.animationsView.clearAnimation()
                binding.animationsView.animation = null
                binding.animationsView.visibility = View.GONE
            } catch (e: Exception) {
                Log.e("TAG", "setAnimations: ${e.message}")
                e.printStackTrace()
            }
        }
    }

-- Versions;

    implementation 'app.rive:rive-android:1.0.2'
    implementation "androidx.startup:startup-runtime:1.1.1"

Thanks for it

umberto-sonnino commented 7 months ago

Hi @srdrakcay, it looks like you're using a very old version of the runtime, can you try updating it to 9.0.7 and see if this is still not working?

srdrakcay commented 7 months ago

Thanks for your suggestion I will share the result here

srdrakcay commented 7 months ago

Its still not working

umberto-sonnino commented 7 months ago

If the Artboard's not found, it might be because you're using the wrong name. Can you share your riv file?

srdrakcay commented 7 months ago

The animations coming from the service, Can you send me your e-mail I can send you the file from there

umberto-sonnino commented 7 months ago

The animations coming from the service, Can you send me your e-mail I can send you the file from there

Sure thing! You can send them at support@rive.app

srdrakcay commented 7 months ago

I send all animations please let me know what the issues

umberto-sonnino commented 7 months ago

Thanks for sharing these! I can see the animations playing correctly on the emulator. If you're trying to load the resources from the network, have you tried taking a look at our network example here?

srdrakcay commented 7 months ago

Thank you ,I use that to but didnt work is it possible to make a call for it ? İf its be possible you can add me on discord "srdrakcay"

srdrakcay commented 7 months ago
vm.fetchUrl("url")
        vm.byteLiveData.observe(viewLifecycleOwner){
            binding.animationsView.setRiveBytes(
                it,
                fit = Fit.COVER
            )
        }

Stil not animating

umberto-sonnino commented 7 months ago
vm.fetchUrl("https://devapp3.boholive.app/assets/animations/chest_animation-5000.riv")
       vm.byteLiveData.observe(viewLifecycleOwner){
           binding.animationsView.setRiveBytes(
               it,
               fit = Fit.COVER
           )
       }

Stil not animating

I just tried that URL in our example and it's running the animation correctly. Have you tried using that?

If it's not working for you, can you share a link to a more complete project (e.g. a GitHub repo) that I can clone to reproduce the issue?

srdrakcay commented 7 months ago

İts a company project sorry for that its not working for me I dont know why There is no error about that