title: cannot initialize the barcode detector
body: <p>recently I'm creating a barcode reader application but unfortunately in my application cannot initialize the barcode detector build. When the initiate the detector the apps will directly close. Is there anyone face this problem before?</p>
  
  <p>this is the source code for the process the barcode</p>
  
  <pre><code>//process barcode
  private void processData(Bitmap myBitmap){
  
      BarcodeDetector barcodeDetector ;
  
      try{
  
           barcodeDetector = new BarcodeDetector.Builder(getApplicationContext())
                  .setBarcodeFormats(Barcode.DATA_MATRIX | Barcode.QR_CODE)
                  .build();
  
          if(!barcodeDetector.isOperational()){
              textview.setText("Could not set up the detector !");
          }
  
  
  
      Frame frame =  new Frame.Builder().setBitmap(myBitmap).build();
      SparseArray&lt;Barcode&gt; barcodes =  barcodeDetector.detect(frame);
  
      if(barcodes.size() &gt; 0) {
  
          try {
              Barcode thisCode = barcodes.valueAt(0);
              JSONObject jsonBObj = new JSONObject(thisCode.displayValue);
  
              lodgingId = jsonBObj.getString(LodgingData.KEY_LODGING_ID);
              userId = jsonBObj.getString(LodgingData.KEY_USER_ID);
  
              textview.setText("data 1 : " + lodgingId + " data 2 : " + userId);
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
      }else{
          textview.setText("Error ");
      }
  
      }catch (Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>gradle build code</p>
  
  <pre><code>dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
      exclude group: 'com.android.support', module: 'support-annotations'
  })
  
  
  
  implementation 'com.google.zxing:core:3.3.0'
  implementation 'com.google.android.gms:play-services-vision:12.0.1'
  implementation 'info.androidhive:barcode-reader:1.1.5'
  implementation 'com.android.support:appcompat-v7:28.0.0'
  implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  implementation 'com.android.support:design:28.0.0'
  implementation 'com.android.support:support-v4:28.0.0'
  implementation 'com.android.support:recyclerview-v7:28.0.0'
  implementation 'com.github.bumptech.glide:glide:3.8.0'
  testImplementation 'junit:junit:4.12'
  implementation 'com.google.firebase:firebase-core:16.0.3'
  implementation 'com.google.firebase:firebase-messaging:17.3.2'
  implementation 'com.google.android.gms:play-services-maps:15.0.1'
  implementation 'com.google.android.gms:play-services-location:15.0.1'
  
  
  
  
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
  </code></pre>
  
  <p>Manifest code</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
  &lt;!--
       The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
       Google Maps Android API v2, but you must specify either coarse or fine
       location permissions for the 'MyLocation' functionality. 
  --&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
  
  
      &lt;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  
      &lt;meta-data
          android:name="com.google.android.gms.vision.DEPENDENCIES"
          android:value="barcode" /&gt;
  
      &lt;service android:name="org.eclipse.paho.android.service.MqttService" /&gt;
  
  
      &lt;activity
          android:name=".loadingPage"
          android:theme="@style/AppTheme.NoActionBar"
          android:windowSoftInputMode="adjustPan"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>Lod cat</strong></p>
  </blockquote>
  
  <pre><code>2018-10-20 23:13:27.800 1018-6418/? W/ActivityManager:   Force finishing activity com.example.johnn.lodgingservicesystemowner/.QRScanner
  2018-10-20 23:13:27.808 1018-3090/? E/ReportTools: This is not beta user build
  2018-10-20 23:13:27.809 12122-12122/com.example.johnn.lodgingservicesystemowner I/Process: Sending signal. PID: 12122 SIG: 9
  2018-10-20 23:13:27.810 746-2326/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
  2018-10-20 23:13:27.810 746-2326/? I/chatty: uid=0(root) engine identical 1 line
  2018-10-20 23:13:27.810 746-2326/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
  2018-10-20 23:13:27.810 1847-2088/? I/ash: com.example.johnn.lodgingservicesystemowner { running duration=154915 UptimeDuration=154914 } transition to: end, reason:not_running
  2018-10-20 23:13:27.810 1847-2088/? I/ash: remove app record pkg: com.example.johnn.lodgingservicesystemowner
  2018-10-20 23:13:27.810 1847-2088/? I/AppManager: removeProcessDependency pid:12122
  2018-10-20 23:13:27.811 746-2326/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
  2018-10-20 23:13:27.811 746-2326/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
  2018-10-20 23:13:27.811 746-2326/? I/iMonitor: create: 901001001
  2018-10-20 23:13:27.811 746-2326/? I/iMonitor: send: 901001001
  2018-10-20 23:13:27.811 746-2326/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
  2018-10-20 23:13:27.838 1018-6418/? V/BroadcastQueue: Finished with ordered broadcast BroadcastRecord{2eaa18a u0 android.intent.action.DROPBOX_ENTRY_ADDED}
  2018-10-20 23:13:27.882 2021-3032/? D/WorkSource: Insert in WorkSource{} @ 0 uid 10015 name com.google.android.gms
  2018-10-20 23:13:27.898 2021-3032/? D/WorkSource: Insert in WorkSource{} @ 0 uid 10015 name com.google.android.gms
  2018-10-20 23:13:27.904 1018-1300/? W/InputDispatcher: channel '22d3b85 com.example.johnn.lodgingservicesystemowner/com.example.johnn.lodgingservicesystemowner.QRScanner (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
  2018-10-20 23:13:27.904 1018-1300/? E/InputDispatcher: channel '22d3b85 com.example.johnn.lodgingservicesystemowner/com.example.johnn.lodgingservicesystemowner.QRScanner (server)' ~ Channel is unrecoverably broken and will be disposed!
  2018-10-20 23:13:27.904 1018-1300/? W/InputDispatcher: channel 'da7bca1 com.example.johnn.lodgingservicesystemowner/com.example.johnn.lodgingservicesystemowner.Home (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
  2018-10-20 23:13:27.904 1018-1300/? E/InputDispatcher: channel 'da7bca1 com.example.johnn.lodgingservicesystemowner/com.example.johnn.lodgingservicesystemowner.Home (server)' ~ Channel is unrecoverably broken and will be disposed!
  2018-10-20 23:13:27.906 1581-2091/? D/HwRecentsLockUtils: Search
  2018-10-20 23:13:27.907 1778-30656/? E/HsmCoreServiceImpl: onTransact in code is: 103
  2018-10-20 23:13:27.908 1778-30656/? I/MediaProcessHandler: playingUids: 
  2018-10-20 23:13:27.909 1018-13710/? D/ActivityManager: Skipping, home or recents stack task: TaskRecord{b246c2f #690 A=com.huawei.android.launcher U=0 StackId=0 sz=1}
  2018-10-20 23:13:27.910 1018-13710/? D/ActivityManager: Skipping intent:flg=0x10804000 cmp=com.android.systemui/.recents.RecentsActivity bnds=[48,1120][1032,2362]
  2018-10-20 23:13:27.910 1018-13710/? D/ActivityManager: Skipping intent:act=android.security.action.START_APP_SECURE flg=0x34808000 pkg=com.huawei.scanner cmp=com.huawei.scanner/.view.SecurityScannerActivity
  2018-10-20 23:13:27.910 1018-13710/? D/ActivityManager: Skipping intent:act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800300 cmp=com.android.settings/.FallbackHome
  2018-10-20 23:13:27.921 1018-3130/? I/ActivityManager: Process com.example.johnn.lodgingservicesystemowner (pid 12122) has died: fore TOP 
  </code></pre>
  
  <blockquote>
    <p>This two message appear in the logcat while error occur</p>
  </blockquote>
  
  <pre><code>    QRScanner (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
  .QRScanner (server)' ~ Channel is unrecoverably broken and will be disposed!
  </code></pre>