Google Mobile Visión kutubxonasi yuklab olinmaydi

Google Mobile Visión TextRecogniser API'ni ilovaga kiritishga harakat qilaman, matnni matnni o'qish uchun. Bu funksiyadan foydalanishga harakat qilsam, men bu xatoni qabul qilaman:

W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801
I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801
W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000005/n/arm64-v8a
D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm64:/system/fake-libs64:/data/app/com.google.android.gms-1/base.apk!/lib/arm64-v8a for namespace 0x7a2e8c60f0
I/Vision: Loading libocr library
I/Vision: libocr load status: false
I/TextRecognizerCreatorImpl: Requesting download for native text recognizer
W/TextNativeHandle: Native handle not yet available. Reverting to no-op handle.

Menimcha, kutubxona telefonga yuklab olinmadi.

Yo'qotilgan internet aloqasi, xotiraning etishmasligi, yo'qolgan bog'liqliklar, telefonni qayta ishga tushirish, Google Play xizmatlarini yangilash, bir muncha vaqt kutib turadigan umumiy xato manbalari bilan bog'liq muammolarni bartaraf etdim. Google do'koni va Play xizmatlari Android studiyasida ham yangilanmoqda.

Shunga qaramay, mening ilovani turli qurilmalarda sinab ko'rsam ham, men xatolarga duch kelaman.

7
Xuddi shu xato xabari bilan bir xil muammolarga duch keldim. Siz echim topdingizmi?
qo'shib qo'ydi muallif Solidus0815, manba
manifest uchun ni qo'shing
qo'shib qo'ydi muallif Kigenyi Phillip, manba
Mening mobil qurilmamdagi Google Play xizmatlari uchun keshni tozalash yordam berdi. Keshni tozalashdan so'ng OCR ilovasini ishlatishga harakat qildim va u hali ishlamadi. O'yin do'konini ishga tushirdim, telefonimni bir muddat va Bingoni tark etdim! Ishlamoqda...
qo'shib qo'ydi muallif Eaweb, manba
Xech qachon hal qila olmayman.
qo'shib qo'ydi muallif Bjoern Plüster, manba

7 javoblar

Men "Google Play xizmati" ilovasining "Ma'lumotlarni o'chirish" bandini bajaraman va u ishlaydi!

5
qo'shib qo'ydi

Kundalik Kutubxona libocr.soni yuklash degan bo'lsa ham. Bu, yuklab olish ishlamayotganligini bildirmaydi. Bu fonda hali ham yuklab olinadi. Yuklashni Google Play xizmati ilovasi amalga oshirganiga ishonaman. Kutubxonalar papkada zip fayli sifatida yuklab olinadi

/data/data/com.google.android.gms/cache/downloadservice

va olinadi

 /data/data/com.google.android.gms/files/com.google.android.gms.vision

va ilova doimo kutubxonani yo'lda tekshiradi

    06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so

bu xatoni ko'rsatmoqda

    06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false   

aks holda

    06-03 09:42:33.372 23451-24679/pzy64.searchbot I/Vision: libocr.so library load status: true

Yuklab olishdan keyin, Mening holimda (ARM) papka kattaligi

 /data/data/com.google.android.gms/files/com.google.android.gms.vision

5MB atrofida. (Shunday qilib, yuklab olingan fayl hajmi bu o'lchamdan kamroq, hajmi turli me'morchilik uchun farq qilishi mumkin .Bu mening Asus Phone (x86) da yuklab olish uchun ko'proq vaqt talab etiladi.

Mening Logcat-ga qarang - ("Vizion" dan foydalanib filtri).

06-02 22:45:45.489 14970-31705/? I/Vision: Registration status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:45:45.542 14970-31705/? I/Vision: Download status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.387 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.410 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.411 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
................... ..............
................... ..............

06-02 22:51:08.364 14970-3424/? I/Vision: Finished download ocr_armeabi_v7a.zip
06-02 22:51:08.421 14970-3424/? I/Vision: Unzipping /data/data/com.google.android.gms/cache/downloadservice/ocr_armeabi_v7a.zip to /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr
06-02 22:51:08.645 14970-3424/? I/Vision: Time to download ocr: 436558
06-02 22:51:09.142 3303-3489/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: libocr.so library load status: true
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: Reading ocr models from /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr/data/models

Men ishlayotgan ilova

4
qo'shib qo'ydi
Men qurilmalardan birini sotib olaman va uni operatsion emas deb bilaman, qanday tuzatish kerakligini bilmayman
qo'shib qo'ydi muallif ChitaRanjan Sahu, manba

Ba'zi bir sinovlardan so'ng, men bu satrlarni faylga qo'shishingiz kerakligini angladim:

compile 'com.android.support:support-v4:24+'
compile 'com.android.support:design:24+'

Shunday qilib, bundan boshqa

'com.google.android.gms: play-services-vision: 10.2.1' ni tuzing boshqa ikki yo'nalish ham muhim ahamiyatga ega.

3
qo'shib qo'ydi
Agar log "libocr load status: false" yozishni davom ettirsa, u hali fonda yuklab qo'yilmoqda. Yuklashni tugatgandan keyin ham, jurnal o'zgarmaydi .. Biz ilovadan chiqishimiz, uni xotiradan o'chirishimiz kerak, ishlashni bilish uchun yana ochishingiz kerak ... Buni "Tuyulgan" logotipi bilan filtrlash orqali ko'rishingiz mumkin. Yuklab olishni pleyerlar tomonidan bajarilganligiga ishonaman. Yuqoridagi sud jarayoni siz uchun ishlagan ... chunki siz sinovlarni amalga oshirayotganda kutubxonani yuklab olish uchun etarli vaqt bo'ldi.
qo'shib qo'ydi muallif Pzy64, manba
Kutib turganingizdan so'ng, uni jurnaldan ko'rishingiz mumkin. libocr.so kutubxonaning yuklanish holati: haqiqiy .. /data/data/com.google.android.gms/files/com.google.android.g‌ ms dan ocr modellarini o'qish. ko'rish/ocr/data/m & zwnj; odels ..
qo'shib qo'ydi muallif Pzy64, manba

Sizning ilovangizning manifest faylida "meta-ma'lumotlar" yorlig'ini qo'shishni unutib yubordingiz. Ushbu meta-ma'lumotlar yorlig'i sizning arizangizni kutubxonani ilovaga yuklab olish va integratsiyalashni bildiradi. Manifest faylidagi "faoliyat" yorlig'i ustida "ilovalar" yorlig'ida meta-ma'lumotlar yorlig'i qo'shishga harakat qiling. Pastga qarang:


        <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"/>
        
            
                

                
            
        
    

Bu sizning muammoingizni hal qilishi mumkin.

2
qo'shib qo'ydi
Matnni aniqlashni ishlatmoqchi bo'lsangiz, android: value = "barcode" o'rniga android: value = "ocr" dan foydalanganingizga ishonch hosil qiling.
qo'shib qo'ydi muallif Alex, manba
Rahmat, lekin bu mening muammomni hal qilmadi. Men hali ham bir xil xato xabari olaman.
qo'shib qo'ydi muallif Bjoern Plüster, manba

Have you included ?

1
qo'shib qo'ydi
Buning sababi, echimdan ko'ra, sharh berish yaxshiroq edi.
qo'shib qo'ydi muallif Pzy64, manba

Buni harakat qilib ko'ring, uning men uchun ishlashi.

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25"
    defaultConfig {
        applicationId "com.truiton.mobile.vision.ocr"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.0'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-vision:9.8.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta3'
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


    

    <button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:text="Scan Text"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1"
        />

    

    

        

            
        
    

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>


    
    
    
        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="ocr"/>
        
            
                

                
            
        
    


MainActivity.java

public class MainActivity extends AppCompatActivity {
    private static final String LOG_TAG = "Text API";
    private static final int PHOTO_REQUEST = 10;
    private TextView scanResults;
    private Uri imageUri;
    private TextRecognizer detector;
    private static final int REQUEST_WRITE_PERMISSION = 20;
    private static final String SAVED_INSTANCE_URI = "uri";
    private static final String SAVED_INSTANCE_RESULT = "result";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button = (Button) findViewById(R.id.button);
        scanResults = (TextView) findViewById(R.id.results);
        if (savedInstanceState != null) {
            imageUri = Uri.parse(savedInstanceState.getString(SAVED_INSTANCE_URI));
            scanResults.setText(savedInstanceState.getString(SAVED_INSTANCE_RESULT));
        }
        detector = new TextRecognizer.Builder(getApplicationContext()).build();
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ActivityCompat.requestPermissions(MainActivity.this, new
                        String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_PERMISSION);
            }
        });
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        switch (requestCode) {
            case REQUEST_WRITE_PERMISSION:
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    takePicture();
                } else {
                    Toast.makeText(MainActivity.this, "Permission Denied!", Toast.LENGTH_SHORT).show();
                }
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == PHOTO_REQUEST && resultCode == RESULT_OK) {
            launchMediaScanIntent();
            try {
                Bitmap bitmap = decodeBitmapUri(this, imageUri);
                if (detector.isOperational() && bitmap != null) {
                    Frame frame = new Frame.Builder().setBitmap(bitmap).build();
                    SparseArray textBlocks = detector.detect(frame);
                    String blocks = "";
                    String lines = "";
                    String words = "";
                    for (int index = 0; index < textBlocks.size(); index++) {
                        //extract scanned text blocks here
                        TextBlock tBlock = textBlocks.valueAt(index);
                        blocks = blocks + tBlock.getValue() + "\n" + "\n";
                        for (Text line : tBlock.getComponents()) {
                            //extract scanned text lines here
                            lines = lines + line.getValue() + "\n";
                            for (Text element : line.getComponents()) {
                                //extract scanned text words here
                                words = words + element.getValue() + ", ";
                            }
                        }
                    }
                    if (textBlocks.size() == 0) {
                        scanResults.setText("Scan Failed: Found nothing to scan");
                    } else {
                        scanResults.setText(scanResults.getText() + "Blocks: " + "\n");
                        scanResults.setText(scanResults.getText() + blocks + "\n");
                        scanResults.setText(scanResults.getText() + "---------" + "\n");
                        scanResults.setText(scanResults.getText() + "Lines: " + "\n");
                        scanResults.setText(scanResults.getText() + lines + "\n");
                        scanResults.setText(scanResults.getText() + "---------" + "\n");
                        scanResults.setText(scanResults.getText() + "Words: " + "\n");
                        scanResults.setText(scanResults.getText() + words + "\n");
                        scanResults.setText(scanResults.getText() + "---------" + "\n");
                    }
                } else {
                    scanResults.setText("Could not set up the detector!");
                }
            } catch (Exception e) {
                Toast.makeText(this, "Failed to load Image", Toast.LENGTH_SHORT)
                        .show();
                Log.e(LOG_TAG, e.toString());
            }
        }
    }

    private void takePicture() {
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        File photo = new File(Environment.getExternalStorageDirectory(), "picture.jpg");
        imageUri = Uri.fromFile(photo);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
        startActivityForResult(intent, PHOTO_REQUEST);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        if (imageUri != null) {
            outState.putString(SAVED_INSTANCE_URI, imageUri.toString());
            outState.putString(SAVED_INSTANCE_RESULT, scanResults.getText().toString());
        }
        super.onSaveInstanceState(outState);
    }

    private void launchMediaScanIntent() {
        Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
        mediaScanIntent.setData(imageUri);
        this.sendBroadcast(mediaScanIntent);
    }

    private Bitmap decodeBitmapUri(Context ctx, Uri uri) throws FileNotFoundException {
        int targetW = 600;
        int targetH = 600;
        BitmapFactory.Options bmOptions = new BitmapFactory.Options();
        bmOptions.inJustDecodeBounds = true;
        BitmapFactory.decodeStream(ctx.getContentResolver().openInputStream(uri), null, bmOptions);
        int photoW = bmOptions.outWidth;
        int photoH = bmOptions.outHeight;

        int scaleFactor = Math.min(photoW/targetW, photoH/targetH);
        bmOptions.inJustDecodeBounds = false;
        bmOptions.inSampleSize = scaleFactor;

        return BitmapFactory.decodeStream(ctx.getContentResolver()
                .openInputStream(uri), null, bmOptions);
    }
}
0
qo'shib qo'ydi
Nima uchun siz qilgan o'zgarishlarni tushuntirmaysiz va sizning kodingizdagi yangilik nima?
qo'shib qo'ydi muallif Pzy64, manba

Men keyinroq bo'lsam, yo'q ammo bolalar, men uchun bir necha soatdan so'ng muammolarni hal qilishdi. Xarid qilish Google Play xizmatlari'ni versiyasiga yangilash (12.6.85) va men qurilmani qayta ishga tushirdim va nimani taxmin qildim? Dastur yaxshi ishladi. Ushbu Google Play xizmatini yangilash uchun men ushbu havoladan foydalandim

bu yerga havolani kiriting

0
qo'shib qo'ydi