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

InflateException in sample on Android 2.3 #12

Closed
kboyarshinov opened this issue Apr 10, 2015 · 2 comments · Fixed by #13
Closed

InflateException in sample on Android 2.3 #12

kboyarshinov opened this issue Apr 10, 2015 · 2 comments · Fixed by #13

Comments

@kboyarshinov
Copy link
Contributor

It happens only on Android 2.3. 4+ is fine.
Stacktrace:

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.qr_readerexample/com.example.qr_readerexample.DecoderActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class com.dlazaro66.qrcodereaderview.QRCodeReaderView
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
            at android.app.ActivityThread.access$1500(ActivityThread.java:117)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.dlazaro66.qrcodereaderview.QRCodeReaderView
            at android.view.LayoutInflater.createView(LayoutInflater.java:518)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.example.qr_readerexample.DecoderActivity.onCreate(DecoderActivity.java:25)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
            at android.app.ActivityThread.access$1500(ActivityThread.java:117)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.example.qr_readerexample.DecoderActivity.onCreate(DecoderActivity.java:25)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
            at android.app.ActivityThread.access$1500(ActivityThread.java:117)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.dlazaro66.qrcodereaderview.QRCodeReaderView.init(QRCodeReaderView.java:96)
            at com.dlazaro66.qrcodereaderview.QRCodeReaderView.<init>(QRCodeReaderView.java:75)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.example.qr_readerexample.DecoderActivity.onCreate(DecoderActivity.java:25)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
            at android.app.ActivityThread.access$1500(ActivityThread.java:117)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)
@kboyarshinov
Copy link
Contributor Author

I've figured out what it was. I tested on Genymotion with no camera, and NPE happened in init method trying to invoke cameraNotFound method on listener. I sent a PR to fix it.

@dlazaro66
Copy link
Owner

Hey! I really appreciate your contribution. I'm going to checkout your PR and merge it

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

Successfully merging a pull request may close this issue.

2 participants