找不到com.google.android.gms.vision.dynamite的FireBase的OCR api本地模块描述符类

时间:2020-02-21 21:56:52

标签: android firebase flutter google-cloud-functions

我正在创建一个应用程序(使用Flutter)来检测图像上的文本,我的应用程序运行正常,没有问题。 明天,我的应用会以某种方式停止在真实设备上检测文本(我尝试了许多不同的设备,并尝试删除播放服务缓存),但仍然可以在模拟器中运行,

在调试模式下,它给我这个错误:

> Considering local module com.google.android.gms.vision.dynamite.text:0 and remote module com.google.android.gms.vision.dynamite.text:0
D/TextNativeHandle(12994): Cannot load feature, fall back to load whole module.
W/DynamiteModule(12994): Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule(12994): Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:2702
I/DynamiteModule(12994): Selected remote version of com.google.android.gms.vision.dynamite, version >= 2702
V/DynamiteModule(12994): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/DynamiteModule(12994): Local module descriptor class for com.google.android.gms.vision.ocr not found.
I/DynamiteModule(12994): Considering local module com.google.android.gms.vision.ocr:0 and remote module com.google.android.gms.vision.ocr:0
E/Vision  (12994): Error loading module com.google.android.gms.vision.ocr optional module true: gg: No acceptable module found. Local version is 0 and remote version is 0.
I/Vision  (12994): Request download for engine ocr is a no-op because rate limiting
I/GRALLOC (12994): LockFlexLayout: baseFormat: 11, yStride: 1280, ySize: 921600, uOffset: 921600,  uStride: 1280
I/Vision  (12994): Loading library libocr.so
I/Vision  (12994): libocr.so library load status: false
I/Vision  (12994): Request download for engine ocr is a no-op because rate limiting
I/GRALLOC (12994): LockFlexLayout: baseFormat: 11, yStride: 1280, ySize: 921600, uOffset: 921600,  uStride: 1280
W/DynamiteModule(12994): Local module descriptor class for com.google.android.gms.vision.dynamite.text not found.
I/DynamiteModule(12994): Considering local module com.google.android.gms.vision.dynamite.text:0 and remote module com.google.android.gms.vision.dynamite.text:0

这是我的清单文件:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.restless.gsmservices">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
     calls FlutterMain.startInitialization(this); in its onCreate method.
     In most cases you can leave this as-is, but you if you want to provide
     additional functionality it is fine to subclass or reimplement
     FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="nameofapp"
    android:icon="@mipmap/ic_launcher">
    <meta-data
        android:name="com.google.firebase.ml.vision.DEPENDENCIES"
        android:value="label, ocr" />
    <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />
</application>

这是应用程序级别的依赖关系:

 def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.restless.gsmservices"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-auth:19.2.0'

}

这是项目级别的依赖项:

    buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我尝试了大约8个小时,但仍然没有运气,

请有人帮我。

0 个答案:

没有答案