thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 39 forks source link

NoSuchMethodError: No static method getNamedColorStateList #17

Closed engmhmoud closed 4 years ago

engmhmoud commented 4 years ago

app is crashing after calling genius sdk

engmhmoud commented 4 years ago

full error java.lang.NoSuchMethodError: No static method getNamedColorStateList(Landroid/content/res/TypedArray;Lorg/xmlpull/v1/XmlPullParser;Landroid/content/res/Resources$Theme;Ljava/lang/String;I)Landroid/content/res/ColorStateList; in class Landroidx/core/content/res/TypedArrayUtils; E/AndroidRuntime(24221): at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:411) E/AndroidRuntime(24221): at androidx.appcompat.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86) E/AndroidRuntime(24221): at androidx.appcompat.app.AppCompatDelegateImpl.attachToWindow(AppCompatDelegateImpl.java:647) E/AndroidRuntime(24221): at androidx.appcompat.app.AppCompatDelegateImpl.ensureWindow(AppCompatDelegateImpl.java:623) E/AndroidRuntime(24221): at androidx.appcompat.app.AppCompatDelegateImpl.onCreate(AppCompatDelegateImpl.java:350) E/AndroidRuntime(24221): at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:105) E/AndroidRuntime(24221): at com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity.onCreate(ScanActivity.java:31) E/AndroidRuntime(24221): at android.app.Activity.performCreate(Activity.java:6904) E/AndroidRuntime(24221): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) E/AndroidRuntime(24221): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266) E/AndroidRuntime(24221): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) E/AndroidRuntime(24221): at android.app.ActivityThread.access$1100(ActivityThread.java:229) E/AndroidRuntime(24221): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) E/AndroidRuntime(24221): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(24221): at android.os.Looper.loop(Looper.java:148) E/AndroidRuntime(24221): at android.app.ActivityThread.main(ActivityThread.java:7406) E/AndroidRuntime(24221): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(24221): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) E/AndroidRuntime(24221): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

guillaume-tgl commented 4 years ago

Could you give us more details about this issue:

engmhmoud commented 4 years ago

on my own app flutter version v1.9.1+hotfix.6 model number SM-G532F flutter_genius_scan: ^3.0.8 windows 7 64bit

  await FlutterGeniusScan.setLicenceKey( '------------------');
        var genios = await FlutterGeniusScan.scanWithConfiguration({
         'source': 'image',
           'multiPage': true,
         });
engmhmoud commented 4 years ago

i created new project with your demo example and get the same error

`Launching lib\main.dart on SM G532F in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
D/libGLESv2(18856): DTS_GLAPI : DTS is not allowed for Package : com.appsvalley.almaktabapp
I/[MALI][Gralloc](18856): [+]r_hnd(0xae4b9180), client(56), share_fd(64)
D/GraphicBuffer(18856): register, handle(0xae4b9180) (w:540 h:960 s:544 f:0x1 u:0x000b00)
D/libGLESv1(18856): DTS_GLAPI : DTS is not allowed for Package : com.appsvalley.almaktabapp
I/[MALI][Gralloc](18856): [+]r_hnd(0xae4b95e0), client(56), share_fd(65)
D/GraphicBuffer(18856): register, handle(0xae4b95e0) (w:540 h:960 s:544 f:0x1 u:0x000b00)
D/ViewRootImpl(18856): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(18856): ViewPostImeInputStage processPointer 1
I/art     (18856): Rejecting re-init on previously-failed class java.lang.Class<com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity>
I/art     (18856): Rejecting re-init on previously-failed class java.lang.Class<com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity>
E/flutter (18856): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/thegrizzlylabs/geniusscan/sdk/ui/ScanActivity;
E/flutter (18856):  at com.thegrizzlylabs.geniusscan.sdk.ui.GeniusScanSdkUI.scanWithConfiguration(GeniusScanSdkUI.java:28)
E/flutter (18856):  at com.thegrizzlylabs.geniusscan.sdk.ui.PluginBridge.scanWithConfiguration(PluginBridge.java:33)
E/flutter (18856):  at com.thegrizzlylabs.geniusscan.sdk.flutter.FlutterGeniusScanPlugin.onMethodCall(FlutterGeniusScanPlugin.java:43)
E/flutter (18856):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/flutter (18856):  at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/flutter (18856):  at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/flutter (18856):  at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (18856):  at android.os.MessageQueue.next(MessageQueue.java:323)
E/flutter (18856):  at android.os.Looper.loop(Looper.java:135)
E/flutter (18856):  at android.app.ActivityThread.main(ActivityThread.java:7406)
E/flutter (18856):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18856):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
E/flutter (18856):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
E/flutter (18856): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity" on path: DexPathList[[zip file "/data/app/com.appsvalley.almaktabapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.appsvalley.almaktabapp-1/lib/arm, /data/app/com.appsvalley.almaktabapp-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
E/flutter (18856):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/flutter (18856):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/flutter (18856):  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/flutter (18856):  ... 13 more
E/flutter (18856):  Suppressed: java.lang.NoClassDefFoundError: com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity
E/flutter (18856):      at dalvik.system.DexFile.defineClassNative(Native Method)
E/flutter (18856):      at dalvik.system.DexFile.defineClass(DexFile.java:226)
E/flutter (18856):      at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
E/flutter (18856):      at dalvik.system.DexPathList.findClass(DexPathList.java:338)
E/flutter (18856):      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
E/flutter (18856):      ... 15 more
E/flutter (18856):  Suppressed: java.lang.ClassNotFoundException: com.thegrizzlylabs.geniusscan.sdk.ui.ScanActivity
E/flutter (18856):      at java.lang.Class.classForName(Native Method)
E/flutter (18856):      at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/flutter (18856):      at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/flutter (18856):      at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/flutter (18856):      ... 14 more
E/flutter (18856):  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
E/flutter (18856):
F/flutter (18856): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
F/libc    (18856): Fatal signal 6 (SIGABRT), code -6 in tid 18856 (ley.almaktabapp)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/grandpplteser/grandpplte:6.0.1/MMB29T/G532FXWU1ARE1:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 18856, tid: 18856, name: ley.almaktabapp  >>> com.appsvalley.almaktabapp <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
'
r0 00000000  r1 000049a8  r2 00000006  r3 b6f7bd9c
r4 b6f7bda4  r5 b6f7bd54  r6 0000000b  r7 0000010c
r8 bebd4d0c  r9 00000000  sl 00000001  fp b6f160c3
ip 00000006  sp bebd4be8  lr b6cd8de5  pc b6cdb1d4  cpsr 400b0010
backtrace:
#00 pc 000431d4  /system/lib/libc.so (tgkill+12)
#01 pc 00040de1  /system/lib/libc.so (pthread_kill+32)
#02 pc 0001c7e7  /system/lib/libc.so (raise+10)
#03 pc 00019a65  /system/lib/libc.so (__libc_android_abort+34)
#04 pc 00017600  /system/lib/libc.so (abort+4)
#05 pc 00fa7b9f  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#06 pc 00f9dde1  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#07 pc 00f9cad7  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#08 pc 00fcfb83  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#09 pc 00fa81f5  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#10 pc 00fab943  /data/app/com.appsvalley.almaktabapp-1/lib/arm/libflutter.so (offset 0xf99000)
#11 pc 00013205  /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+532)
#12 pc 000132d7  /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+130)
#13 pc 00084e91  /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#14 pc 0305a575  /system/framework/arm/boot.oat (offset 0x305a000)
Tombstone written to: /data/tombstones/tombstone_07
Lost connection to device.
Exited (sigterm)`
guillaume-tgl commented 4 years ago

That's not the same issue. Which Android version does your device have?

engmhmoud commented 4 years ago

That's not the same issue. Which Android version does your device have?

android 6.0.1

guillaume-tgl commented 4 years ago

Could you share your project so that we can investigate what's wrong? I haven't been able to reproduce your issue with our demo app located at https://github.com/thegrizzlylabs/geniusscan-sdk-demo/tree/master/flutter-plugin-genius-scan-demo

engmhmoud commented 4 years ago

what is different

engmhmoud commented 4 years ago

Could you share your project so that we can investigate what's wrong? I haven't been able to reproduce your issue with our demo app located at https://github.com/thegrizzlylabs/geniusscan-sdk-demo/tree/master/flutter-plugin-genius-scan-demo

you want gradle and menifist any other files???

engmhmoud commented 4 years ago

app build gradle

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 plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

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.appsvalley.almaktabapp"
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.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 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-analytics:17.2.0'

}
apply plugin: 'com.google.gms.google-services'
engmhmoud commented 4 years ago

build gradle

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

    dependencies {
        // classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
    subprojects {
    project.configurations.all {
    resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'androidx.core' &&
           !details.requested.name.contains('androidx')) {
        details.useVersion "1.0.1"
            }
    }
    }    
}
}

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
}
engmhmoud commented 4 years ago

manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.appsvalley.almaktabapp">

    <!-- 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.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="AlMAKTAB"
        android:icon="@mipmap/ic_launcher">

        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">

                <!-- <provider
                android:name="androidx.core.content.FileProvider"
                android:authorities="${applicationId}.fileProvider"
                android:exported="false"
                android:grantUriPermissions="true"
                tools:replace="android:authorities">
            <meta-data
                    android:name="android.support.FILE_PROVIDER_PATHS"
                    android:resource="@xml/filepaths"
                    tools:replace="android:resource" />
        </provider> -->
            <!-- This keeps the window background of the activity showing
                 until Flutter renders its first frame. It can be removed if
                 there is no splash screen (such as the default splash screen
                 defined in @style/LaunchTheme). -->
            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>
engmhmoud commented 4 years ago

is there is any wrong in these files if not can you help me with team viewer ???or any other solution

bvirlet commented 4 years ago

i created new project with your demo example and get the same error

As requested by @guillaume-tgl, can you zip the entire project you created from the demo, and attach it here?

engmhmoud commented 4 years ago

genias complete app.zip

engmhmoud commented 4 years ago

any kind of help can i get her???????????????

guillaume-tgl commented 4 years ago

I've studied your project and there seems to be a dependency conflict between our SDK and Firebase Analytics SDK. I've managed to solve it by adding this to your android/build.gradle file (and not android/app/build.gradle):

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'androidx.core' &&
                    !details.requested.name.contains('androidx')) {
                details.useVersion "1.1.0"
            }
        }
    }
}
engmhmoud commented 4 years ago

@guillaume-tgl solved for me thanks alot

engmhmoud commented 4 years ago

still have the error in some devices and some other devices are running well ?????

Can you please take the time to report exactly what's happening. What are "deicies"? What devices are affected? What error are you seeing on those devices? Have you done a clean build?

bvirlet commented 4 years ago

Can you please take the time to report exactly what's happening. What are "deicies"? What devices are affected? What error are you seeing on those devices? Have you done a clean build?

engmhmoud commented 4 years ago

Can you please take the time to report exactly what's happening. What are "deicies"? What devices are affected? What error are you seeing on those devices? Have you done a clean build?

yes i done rebuild just white screen then crashing will send type of devices

engmhmoud commented 4 years ago

Huawei Honor play .Android 9.1

and this Huawei too IMG-20191205-WA0010

oppo f3 Huawei Tablet T3 - android 7.0

guillaume-tgl commented 4 years ago

Can you share the error stack trace? And can you share a project where we can reproduce the issue?

engmhmoud commented 4 years ago

the same project above

engmhmoud commented 4 years ago

Built build\app\outputs\apk\debug\app-debug.apk. E/flutter ( 6064): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.appsvalley.almaktabapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.appsvalley.almaktabapp-2/lib/arm, /data/app/com.appsvalley.almaktabapp-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libgs-sdk.so" E/flutter ( 6064): at java.lang.Runtime.loadLibrary(Runtime.java:367) E/flutter ( 6064): at java.lang.System.loadLibrary(System.java:1076) E/flutter ( 6064): at com.thegrizzlylabs.geniusscan.sdk.core.GeniusScanLibrary.(GeniusScanLibrary.java:44) E/flutter ( 6064): at com.thegrizzlylabs.geniusscan.sdk.core.GeniusScanLibrary.init(GeniusScanLibrary.java:53) E/flutter ( 6064): at com.thegrizzlylabs.geniusscan.sdk.ui.PluginBridge.setLicenseKey(PluginBridge.java:155) E/flutter ( 6064): at com.thegrizzlylabs.geniusscan.sdk.flutter.FlutterGeniusScanPlugin.onMethodCall(FlutterGeniusScanPlugin.java:39) E/flutter ( 6064): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222) E/flutter ( 6064): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96) E/flutter ( 6064): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656) E/flutter ( 6064): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter ( 6064): at android.os.MessageQueue.next(MessageQueue.java:323) E/flutter ( 6064): at android.os.Looper.loop(Looper.java:135) E/flutter ( 6064): at android.app.ActivityThread.main(ActivityThread.java:7406)

engmhmoud commented 4 years ago

Built build\app\outputs\apk\debug\app-debug.apk. E/flutter ( 9056): [ERROR:flutter/shell/platform/android/android_context_gl.cc(165)] Could not choose an EGL configuration. E/flutter ( 9056): [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_SUCCESS (12288) F/flutter ( 9056): [FATAL:flutter/shell/platform/android/platform_view_android.cc(29)] Check failed: androidsurface. Could not create an OpenGL, Vulkan or Software surface to setup rendering.

guillaume-tgl commented 4 years ago

Okay, this is not the same error as the previous time. Is your app built for arm64-v8a? Could you send an APK of the app that has this issue?

engmhmoud commented 4 years ago

Okay thanks alot the first issue solved the second wasn't from genius because debug mode in flutter not support all bundle thanks again