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

Fatal signal 6 (SIGABRT) #32

Closed
aman-sahai opened this issue Jan 18, 2021 · 12 comments
Closed

Fatal signal 6 (SIGABRT) #32

aman-sahai opened this issue Jan 18, 2021 · 12 comments

Comments

@aman-sahai
Copy link

Hi, I am getting Fatal signal 6 (SIGABRT) error after I crop the video and click on tick button in TrimVideo Activity. Below is the log at the time of crash. Kindly look into the issue and revert as quickly as possible.

2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] native: #11 pc 00000000000ac4d4 /system/framework/arm64/boot.oat (Java_java_lang_Runtime_nativeLoad__Ljava_lang_String_2Ljava_lang_ClassLoader_2Ljava_lang_String_2+228)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.nativeLoad(Native method)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.doLoad(Runtime.java:1099)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] - locked <0x0f928db3> (a java.lang.Runtime)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.loadLibrary0(Runtime.java:1014)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] - locked <0x0f928db3> (a java.lang.Runtime)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.System.loadLibrary(System.java:1657)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at com.arthenica.mobileffmpeg.Config.(:133)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at com.arthenica.mobileffmpeg.Config.b(:623)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at e.a.a.b.a(:54)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at e.a.a.b.doInBackground(:29)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at android.os.AsyncTask$2.call(AsyncTask.java:333)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Thread.run(Thread.java:764)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516]

--------- beginning of crash
2021-01-16 17:29:05.746 12315-13269/igcoco.classtrak A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 13269 (AsyncTask #3)

@a914-gowtham
Copy link
Owner

Can you share the device details

@aman-sahai
Copy link
Author

aman-sahai commented Jan 18, 2021

The crash was happening throughout all devices. This error was found in release mode with following values
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
resValue "string", "app_name", "@string/app_name_release"
debuggable false
and when I changed minifyEnabled to false, the crash stopped happening.

@a914-gowtham
Copy link
Owner

a914-gowtham commented Jan 18, 2021

Add this proguard rules

-dontwarn com.gowtham.library**
-keep class com.gowtham.library** { *; }
-keep interface com.gowtham.library** { *; }

@aman-sahai
Copy link
Author

Already added this proguard rules but it still doesn't work.

@a914-gowtham
Copy link
Owner

I don't know what went wrong? try this solution . are you using jitpack dependency or your own pulled code

@aman-sahai
Copy link
Author

Jitpack dependency is added.
The crash is happening in the sample code as well.

@a914-gowtham
Copy link
Owner

a914-gowtham commented Jan 19, 2021

send the video uri and code that you used to trim the video

@aman-sahai
Copy link
Author

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode != Activity.RESULT_OK) {
return
}
try {
if (requestCode == VideoUtil.VideoSource.VIDEO_GALLERY) {
val uri = data?.data
filePathUri = uri
viewModel.videoPath.value = getRealPathFromUri(uri)
Log.d("URI:", "" + getRealPathFromUri(uri))
Toast.makeText(this@UploadVideoActivity, "Video uploaded.", Toast.LENGTH_LONG).show()
uploadedVideo.setVideoURI(uri)
uploadedVideo.setOnPreparedListener(MediaPlayer.OnPreparedListener { mp ->
mp.setOnVideoSizeChangedListener { mp, width, height ->
var mc = MediaController(this@UploadVideoActivity)
mc.show(5000)
uploadedVideo.setMediaController(mc)
mc.setAnchorView(uploadedVideo)
}
})
uploadedVideo.start()

        } else if (requestCode == TrimVideo.VIDEO_TRIMMER_REQ_CODE && data != null) {
            val uri = Uri.parse(TrimVideo.getTrimmedVideoPath(data))
            Log.d("URI:", "" + uri)
            viewModel.videoPath.value = uri.toString()
            Log.d(TAG, "Trimmed path:: $uri")
            uploadedVideo!!.setMediaController(mediaController)
            uploadedVideo.setVideoURI(uri)
            uploadedVideo.requestFocus()
            uploadedVideo.start()
            val filepath = uri.toString()
            val file = File(filepath)
            val length = file.length()
            Log.d(TAG, "Video size:: " + length / 1024)
        }
    } catch (e: Exception) {
        e.printStackTrace()
    }
}


fun getRealPathFromUri(contentUri: Uri?): String? {
    var cursor: Cursor? = null
    return try {

        val proj = arrayOf(MediaStore.Video.Media.DATA)
        cursor = contentUri?.let { contentResolver.query(it, proj, null, null, null) }
        assert(cursor != null)
        val columnIndex: Int = cursor!!.getColumnIndexOrThrow(MediaStore.Video.Media.DATA)
        cursor!!.moveToFirst()
        cursor!!.getString(columnIndex)
    } finally {
        if (cursor != null) {
            cursor.close()
        }
    }
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.menu_upload_cropped_video, menu)
return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
    when (item.itemId) {
        R.id.menu_crop_video -> {
            onDefaultTrimClicked()
        }
    }
    return true
}

private fun openTrimActivity(data: String) {
if (trimType == 0) {
mFile = Date().time.toString()
TrimVideo.activity(data)
//.setCompressOption(new CompressOption()) //pass empty constructor for default compress option
.setDestination("/storage/emulated/0/DCIM/TESTFOLDER")
.setFileName(mFile)
.start(this)
Log.v("mFile:", mFile)
}
}
private fun onDefaultTrimClicked() {
trimType = 0
if (checkCamStoragePer()) {
openTrimActivity(filePathUri.toString())
}l̥
}

private fun checkCamStoragePer(): Boolean {
    return checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
            Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
}


override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    if (isPermissionOk(grantResults)) {
        onDefaultTrimClicked()
    }
}

private fun isPermissionOk(grantResults: IntArray): Boolean {
    var isAllGranted: Boolean = true
    for (result in grantResults) {
        if (PackageManager.PERMISSION_GRANTED != result) {
            isAllGranted = false
            break
        }
    }
    return isAllGranted
}


private fun checkPermission(vararg permissions: String): Boolean {
    var allPermitted = false
    for (permission in permissions) {
        allPermitted = (ContextCompat.checkSelfPermission(this, permission)
                === PackageManager.PERMISSION_GRANTED)
        if (!allPermitted) break
    }
    if (allPermitted) return true
    ActivityCompat.requestPermissions(this, permissions,
            220)
    return false
}

@lijusparkt
Copy link

lijusparkt commented Mar 1, 2021

Heloooo Guys.
Any update on this ..?
I'm also facing the same issue ,only when we add proguard rules. (minifyEnabled true)

Crash catch in analytics
Fatal Exception: java.lang.IllegalArgumentException
com.gowtham.library.ui.ActVideoTrimmer.getCompressionCommand

android.media.MediaMetadataRetriever.setDataSource (MediaMetadataRetriever.java:77)
com.gowtham.library.ui.ActVideoTrimmer.getCompressionCommand (ActVideoTrimmer.java:502)
com.gowtham.library.ui.ActVideoTrimmer.validateVideo (ActVideoTrimmer.java:485)
com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected (ActVideoTrimmer.java:456)
android.app.Activity.onMenuItemSelected (Activity.java:4137)
androidx.fragment.app.FragmentActivity.onMenuItemSelected (FragmentActivity.java:383)
androidx.appcompat.app.AppCompatActivity.onMenuItemSelected (AppCompatActivity.java:219)
androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected (WindowCallbackWrapper.java:109)
androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected (WindowCallbackWrapper.java:109)
androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick (ToolbarActionBar.java:64)
androidx.appcompat.widget.Toolbar$1.onMenuItemClick (Toolbar.java:207)
androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected (ActionMenuView.java:781)
androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected (MenuBuilder.java:840)
androidx.appcompat.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:158)
androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:991)
androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:981)
androidx.appcompat.widget.ActionMenuView.invokeItem (ActionMenuView.java:625)
androidx.appcompat.view.menu.ActionMenuItemView.onClick (ActionMenuItemView.java:151)
android.view.View.performClick (View.java:7140)
android.view.View.performClickInternal (View.java:7117)
android.view.View.access$3500 (View.java:801)
android.view.View$PerformClick.run (View.java:27355)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7397)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:935)

@a914-gowtham
Copy link
Owner

a914-gowtham commented Mar 1, 2021

It seems like your issue is different than this, this issue happens in FFmpeg native code but, your issue has happened in Video trimmer library. Can you create the issue as a new issue

@lijusparkt
Copy link

Thanks Gowtham.
I will create.

@a914-gowtham
Copy link
Owner

a914-gowtham commented Mar 14, 2021

Duplicate of #35

@a914-gowtham a914-gowtham marked this as a duplicate of #35 Mar 15, 2021
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

3 participants