ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.14k stars 1.57k forks source link

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.utkarshbharat/com.yalantis.ucrop.UCropActivity}: android.view.InflateException: Binary XML file line #27: Binary XML file line #46: Error inflating class ImageView #1710

Open pushpender-singh-ap opened 2 years ago

pushpender-singh-ap commented 2 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behavior

Work properly without crash

Actual behavior

App Crash

Stack trace

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.utkarshbharat/com.yalantis.ucrop.UCropActivity}: android.view.InflateException: Binary XML file line #27: Binary XML file line #46: Error inflating class ImageView
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6718)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f070136
       at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:255)
       at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:785)
       at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:631)
       at android.content.res.Resources.loadDrawable(Resources.java:897)
       at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:955)
       at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
       at android.content.res.XResources$XTypedArray.getDrawable(XResources.java:1374)
       at android.widget.ImageView.<init>(ImageView.java:189)
       at android.widget.ImageView.<init>(ImageView.java:172)
       at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:74)
       at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:69)
       at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:199)
       at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:119)
       at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
       at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
       at EdHooker_.hook(:186)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
       at android.view.LayoutInflater.parseInclude(LayoutInflater.java:995)
       at EdHooker_.hook(:165)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:859)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
       at EdHooker_.hook(:156)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
       at com.yalantis.ucrop.UCropActivity.setupViews(UCropActivity.java:309)
       at com.yalantis.ucrop.UCropActivity.onCreate(UCropActivity.java:130)
       at android.app.Activity.performCreate(Activity.java:7144)
       at android.app.Activity.performCreate(Activity.java:7135)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6718)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
anhkieet commented 2 years ago

Same here, I got this error on Firebase crashlytics

pushpender-singh-ap commented 2 years ago

@ivpusic Any solution?

zynhrus commented 1 year ago

@ivpusic @pushpender-singh-ap Any update?

I got the error from Firebase crashlytics too, I can't reproduce it

pushpender-singh-ap commented 1 year ago

@zynhrus The solution to this problem is not yet available to me. I am also searching for it, so if you find it, please let us know.

ghost commented 1 year ago

Hi, These crash is trending now in firebase android for Nexus 5x Android Version 8.1.0

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{__app_name__/com.yalantis.ucrop.UCropActivity}: android.view.InflateException: Binary XML file line #27: Binary XML file line #46: Error inflating class ImageView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

It is causing the issue because of the ucrop used in npm Please check these link https://github.com/Yalantis/uCrop/issues/793

Not able to resolve it