a914-gowtham / android-video-trimmer

Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
Other
362 stars 115 forks source link

Crash When opening a video : Caused by java.lang.NoSuchFieldException DEFAULT #57

Open sandilya28 opened 3 years ago

sandilya28 commented 3 years ago

Stack trace for the crash

com.gowtham.library.utils.TrimVideo$ActivityBuilder.getIntent (TrimVideo.java:135)
com.gowtham.library.utils.TrimVideo$ActivityBuilder.start (TrimVideo.java:98)
com.tingo.videotone.ui.feed.DiscoverActivity.resultLauncher$lambda-9 (DiscoverActivity.java:202)
com.tingo.videotone.ui.feed.DiscoverActivity.lambda$mpR488IrPcg5SyeaiGNXEyPojn0 (DiscoverActivity.java:34)
com.tingo.videotone.ui.feed.-$$Lambda$DiscoverActivity$mpR488IrPcg5SyeaiGNXEyPojn0.onActivityResult (-.java:34)

@a914-gowtham Could you please help me debug this crash?

a914-gowtham commented 3 years ago

@sandilya28 Can you share the code that you used to open the activity

sandilya28 commented 3 years ago

For picking the video from the gallery:

    private fun showVideoPickerActivity() {
        val mimetypes = arrayOf("image/*", "video/*")
        Intent().apply {
            action = Intent.ACTION_PICK
            type = "video/*"
            putExtra(Intent.EXTRA_MIME_TYPES, mimetypes)
            resultLauncher.launch(this)
        }
    }

    private val resultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
        if (result.resultCode == Activity.RESULT_OK) {
            val data : Intent? = result.data
            val videoUri = data?.data

            TrimVideo.activity(videoUri.toString())
                .setHideSeekBar(true)
                .setMinToMax(10, 45)
                .start(this, startForResult)
        }
    }

Here it is @a914-gowtham.

a914-gowtham commented 3 years ago

@sandilya28 could you try this one

TrimVideo.activity(videoUri.toString())
                .setTrimType(TrimType.MIN_MAX_DURATION)
                .setHideSeekBar(true)
                .setMinToMax(10, 45)
                .start(this, startForResult)
sandilya28 commented 3 years ago

Sorry, @a914-gowtham unfortunately the same issue persists.

a914-gowtham commented 3 years ago
  1. Are you using samsung device?
  2. Is this only happen in the release build?
sandilya28 commented 3 years ago
  1. Yes, Galaxy A50.
  2. Yes, this is happening only in the release build.
a914-gowtham commented 3 years ago

@akashmi Try adding this in your proguard-rules

-keepclassmembers enum * { *; }