jakub.petr
jakub.petr

Reputation: 3031

Barcode API libbarhopper.so

I am trying to use Barcode API following this sample https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader but can't get the BarcodeDetector to work.

BarcodeDetector is not operational. The log is full of these two messages:

11-18 17:01:17.346 6661-6800/me.androidwrapper I/Vision: Loading library libbarhopper.so
11-18 17:01:17.347 6661-6800/me.androidwrapper I/Vision: libbarhopper.so library load status: false

I assume that the library couldn't be downloaded. I have 4 GB free in memory.

gradle.build

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.0"

        defaultConfig {
            applicationId "me.androidwrapper"
            minSdkVersion 22
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')

        compile 'com.android.support:appcompat-v7:22.0.0'
        compile 'com.google.code.gson:gson:2.3.1'
        compile 'commons-codec:commons-codec:1.10'

        compile 'com.google.android.gms:play-services-vision:8.4.0'
    }

AndroidManifest.xml

  <?xml version="1.0" encoding="utf-8"?>
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="me.androidwrapper"
    android:installLocation="auto">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.NFC" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_fy_logo"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="barcode" />


        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SettingsActivity"
            android:label="@string/title_activity_settings" />
        <activity android:name=".BarcodeCaptureActivity"
            android:label="Read Barcode"/>
    </application>

</manifest>

I also tried to restart the phone and uninstall the application manually.

Device: Honor 7 with android 7

Thanks for help

Upvotes: 4

Views: 5478

Answers (2)

Alberto M
Alberto M

Reputation: 1760

Tried a bunch of different things found on web, and these are the steps that fixed it for me:

  • Deleted my app
  • Updated google play services to the latest version
  • Cleared the cache and all data from Google Play Services
  • Re-installed my app

Upvotes: 0

Dj_k_
Dj_k_

Reputation: 51

I encountered the same issue. In my case, it was because of low space/memory issue. I tried to free up some space/memory, but this issue still persisted even after restart and reinstall.

I did "Clear data" for "Google Play services for Instant Apps" and somehow this issue get resolved.

Upvotes: 5

Related Questions