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 crash when submit cutting #82

Open
jhongyi opened this issue Dec 13, 2024 · 10 comments
Open

android crash when submit cutting #82

jhongyi opened this issue Dec 13, 2024 · 10 comments

Comments

@jhongyi
Copy link

jhongyi commented Dec 13, 2024

I set maxDuration: 10s and confirm submit to cutting, the app will crash (but iOS is work fine), what' problem?

  1. my device: google pixel / android 14
  2. react native version: 0.68.2
  3. react-native-video-trim version: 2.2.11

build.gradle

    packagingOptions {
        pickFirst '**/*.so'
    }

  dependencies {
      implementation fileTree(dir: "libs", include: ["*.jar"])
  
      //noinspection GradleDynamicVersion
      // implementation "com.facebook.react:react-native:+"  // From node_modules (Error Ref:https://github.com/facebook/react-native/issues/35204)
      implementation "com.facebook.react:react-native:0.68.2!!"  // From node_modules
  
      // implementation 'com.google.android.play:core:1.10.3'
      // implementation 'com.google.android.play:core-ktx:1.8.1'
  
      implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' // google-signin
  
      implementation 'com.facebook.android:facebook-android-sdk:latest.release' // fbsdk
  
      // Use Badge on Android
      implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
  
      // For Animated GIF support
      implementation 'com.facebook.fresco:fresco:2.0.0'
      implementation 'com.facebook.fresco:animated-gif:2.6.0'
  
      implementation 'org.jetbrains:annotations:16.0.2'
      implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
  
      debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
          exclude group:'com.facebook.fbjni'
      }
  
      debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
          exclude group:'com.facebook.flipper'
          exclude group:'com.squareup.okhttp3', module:'okhttp'
      }
  
      debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
          exclude group:'com.facebook.flipper'
      }
  
      if (enableHermes) {
          def hermesPath = "../../node_modules/hermes-engine/android/";
          debugImplementation files(hermesPath + "hermes-debug.aar")
          releaseImplementation files(hermesPath + "hermes-release.aar")
      } else {
          implementation jscFlavor
      }
  }
Dec-13-2024.17-59-45.mp4
@maitrungduc1410
Copy link
Owner

@jhongyi at the time it crashed there should be some error log in Logcat of Android studio, can you get it and show me?

@jhongyi
Copy link
Author

jhongyi commented Dec 13, 2024

@jhongyi at the time it crashed there should be some error log in Logcat of Android studio, can you get it and show me?

logcat.txt

@maitrungduc1410
Copy link
Owner

@jhongyi are you able to reproduce the error consistently?

@jhongyi
Copy link
Author

jhongyi commented Dec 16, 2024

@jhongyi are you able to reproduce the error consistently?

Are you saying that the operation video I provided is not clear enough?
Or do I need to provide some specific configuration files or steps?

@maitrungduc1410
Copy link
Owner

i tried searching the error crash in the original ffmpeg-repo, there are some people faced the same issue: arthenica/ffmpeg-kit#795

but not really clear solution how to solve it

That's why I'm asking you if you can reproduce the error consistently, everytime?

@maitrungduc1410
Copy link
Owner

maitrungduc1410 commented Dec 16, 2024

which Android version are you using? 15?

arthenica/ffmpeg-kit#1000

@jhongyi
Copy link
Author

jhongyi commented Dec 16, 2024

which Android version are you using? 15?

arthenica/ffmpeg-kit#1000

My first comment have mentioned:I using Android 14 to test #82 (comment)

That's my code:

class XXX extends Component {
  componentDidMount() {
    const eventEmitter = new NativeEventEmitter(NativeModules.VideoTrim);
    this.videoTrimListener = eventEmitter.addListener('VideoTrim', event => {
      switch (event.name) {
        case 'onLoad': {
          console.log('onLoadListener', event);
          break;
        }
        case 'onFinishTrimming': {
          handleAndroidTrimResponse(event.outputPath);
          break;
        }
        case 'onError': {
          console.log('onError', event);
          break;
        }
      }
    });
  }

  handleVideoCutting = videoPath => {
      showEditor(videoPath, {
        maxDuration: 10,
        cancelButtonText: '取消',
        cancelDialogTitle: '取消編輯',
        cancelDialogMessage: '確定要取消編輯影片?',
        cancelDialogCancelText: '取消',
        cancelDialogConfirmText: '確定',
        saveButtonText: '確定',
        saveDialogTitle: '儲存影片',
        saveDialogMessage: '確定要儲存編輯後的影片?',
        saveDialogCancelText: '取消',
        saveDialogConfirmText: '確定',
        trimmingText: '處理中 ...',
        cancelTrimmingButtonText: '取消',
        outputExt: 'mp4',
        closeWhenFinish: true,
      });
  }
  render() {
    ...
  }
}

@maitrungduc1410
Copy link
Owner

there's a fix for this. I'm checking if it has been released: arthenica/ffmpeg-kit#1000 (comment)

@jhongyi
Copy link
Author

jhongyi commented Dec 25, 2024

Hi, I would like to know if this issue was eventually resolved?

@maitrungduc1410
Copy link
Owner

Not yet, the ffmpegkit hasn't released new version with the fix. I'll update you once done

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

2 participants