{"action":"closed","issue":{"url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1415","repository_url":"https://api.github.com/repos/react-native-community/react-native-camera","labels_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1415/labels{/name}","comments_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1415/comments","events_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1415/events","html_url":"https://github.com/react-native-community/react-native-camera/issues/1415","id":309749706,"number":1415,"title":"RNCamera 1.0.3 crashes on Android after the addition of text recognition.","user":{"login":"kraffslol","id":152176,"avatar_url":"https://avatars3.githubusercontent.com/u/152176?v=4","gravatar_id":"","url":"https://api.github.com/users/kraffslol","html_url":"https://github.com/kraffslol","followers_url":"https://api.github.com/users/kraffslol/followers","following_url":"https://api.github.com/users/kraffslol/following{/other_user}","gists_url":"https://api.github.com/users/kraffslol/gists{/gist_id}","starred_url":"https://api.github.com/users/kraffslol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kraffslol/subscriptions","organizations_url":"https://api.github.com/users/kraffslol/orgs","repos_url":"https://api.github.com/users/kraffslol/repos","events_url":"https://api.github.com/users/kraffslol/events{/privacy}","received_events_url":"https://api.github.com/users/kraffslol/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-29T13:14:04Z","updated_at":"2018-03-30T16:41:31Z","closed_at":"2018-03-30T16:41:31Z","author_association":"NONE","body":"### Which implementation are you using\r\n\r\nRNCamera\r\n\r\n### Steps to reproduce\r\n1.  Start out at react-native-camera@1.0.2\r\n2. yarn install react-native-camera@1.0.3\r\n3. Try to use the camera. It will likely crash on android.\r\n\r\n### Does it work with Expo Camera?\r\nYes.\r\n\r\n### Expected behaviour\r\nI expect the camera to start up without crashing the app.\r\n\r\n### Actual behaviour\r\nInitializing the camera will crash the app on android. Tried to find what caused it by going from commit to commit and found the culprit to be #1388.  Logcat error:\r\n\r\n```\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbko;\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.google.android.gms.vision.text.TextRecognizer$Builder.<init>(Unknown Source)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at org.reactnative.camera.RNCameraView.<init>(RNCameraView.java:83)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at org.reactnative.camera.CameraViewManager.createViewInstance(CameraViewManager.java:53)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at org.reactnative.camera.CameraViewManager.createViewInstance(CameraViewManager.java:16)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:224)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:153)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:813)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:926)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue.access$2100(UIViewOperationQueue.java:47)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:986)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:136)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:872)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:686)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:618)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:751)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:154)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6119)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.zzbko\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at java.lang.VMClassLoader.findLoadedClass(Native Method)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:362)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime:        ... 25 more\r\n03-29 12:15:18.565 27740 27740 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/safeparcel/zza;\r\n```\r\n\r\n### Environment\r\n- **Node.js version**: 9.4.0\r\n- **React Native version**: 0.53.3\r\n- **React Native platform + platform version**: Android 7.1.1\r\n\r\n### react-native-camera\r\n**Version**: 1.0.3\r\n\r\n\r\n### Potential solution\r\nI managed to fix this issue by changing my build.gradle file. Seems like the text recognition part isn't in play-services-vision version 10.2.0 which is the default for this package.\r\n\r\nChanging from \r\n\r\n```gradle\r\ncompile (project(':react-native-camera')) {\r\n    exclude group: \"com.google.android.gms\"\r\n    compile 'com.android.support:exifinterface:27.+'\r\n    compile (\"com.google.android.gms:play-services-vision:10.2.0\") {\r\n  \t    force = true;\r\n   }\r\n}\r\n```\r\n\r\nto \r\n\r\n```gradle\r\ncompile (project(':react-native-camera')) {\r\n    exclude group: \"com.google.android.gms\"\r\n    compile 'com.android.support:exifinterface:27.+'\r\n    compile (\"com.google.android.gms:play-services-vision:12.+\")\r\n}\r\n```\r\n\r\nfixed the issue for me.\r\n"}}
{"actor":{"display_login":"jgfidelis"}}