Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android unable to load files that contains sound #254

Open
ipekmuhammet opened this issue Jun 5, 2024 · 0 comments
Open

Android unable to load files that contains sound #254

ipekmuhammet opened this issue Jun 5, 2024 · 0 comments

Comments

@ipekmuhammet
Copy link

ipekmuhammet commented Jun 5, 2024

Description

1 - Android unable to load any .riv files that contains sound, shows blank space. When i export same file without sound, it works.
2 - Android unable to load .riv file around 25mb. App crashes 'cause of out of memory with below error. Android only works with adding this option to manifest; android:largeHeap="true". Is this option has any drawbacks?

Error i get;

Abort message: 'JNI DETECTED ERROR IN APPLICATION: JNI GetArrayLength called with pending exception java.lang.OutOfMemoryError: Failed to allocate a 41333784 byte allocation with 9940736 free bytes and 9707KB until OOM, target footprint 201326592, growth limit 201326592
06-05 23:44:27.250 12778 12778 F DEBUG : at int[] app.rive.runtime.kotlin.core.Decoder.decodeToPixels(byte[]) (Decoder.java:22)

Provide a Repro

import React from 'react';
import {
  Dimensions, StyleSheet, Text, View,
} from 'react-native';

import Rive, { RiveRenderer, RiveRendererAndroid, RiveRendererIOS } from 'rive-react-native';

import Button from '../components/Button';

const App = () => {
  const riveRef = React.useRef();

  return (
    <View style={{
      flex: 1,
      alignItems: 'center',
      paddingVertical: 50,
      gap: 10,
    }}
    >
      <Rive
        ref={riveRef}
        resourceName="rockstar3"
        onError={(err) => {
          console.log('err', err);
        }}
        onPlay={() => {
          console.log('here');
        }}
        style={{ width: Dimensions.get('window').width }}
        stateMachineName="Rockstar Avatar Creator"
        autoplay={false}
      />

      <Button
        text="Green Skin"
        onPress={() => {
          riveRef.current?.setInputState('Rockstar Avatar Creator', 'Skin Tone', 3);
        }}
      />
      <Button
        text="Yellow Skin"
        onPress={() => {
          riveRef.current?.setInputState('Rockstar Avatar Creator', 'Skin Tone', 1);
        }}
      />
    </View>
  );
};

export default App;

const styles = StyleSheet.create({});

Source .riv/.rev file

https://rive.app/community/files/9909-18904-rockstar-avatar-creator/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant