awesome_notifications icon indicating copy to clipboard operation
awesome_notifications copied to clipboard

PlatformException(SHARED_PREFERENCES_NOT_AVAILABLE, class p2.b isn't parameterized, sharedPreferences.get, null)

Open Sebuahhobi opened this issue 8 months ago • 2 comments

I get an error when I use API 34

Version: awesome_notifications: ^0.9.3+1

build.gradle ` android { namespace "com...." compileSdk 34 ndkVersion '26.1.10909125'

compileOptions {
    sourceCompatibility JavaVersion.VERSION_18
    targetCompatibility JavaVersion.VERSION_18
}

kotlinOptions { jvmTarget = '18' } kotlin { jvmToolchain(18) }

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

defaultConfig {
    applicationId "com...."
    minSdkVersion 22
    targetSdkVersion 34
    multiDexEnabled true
    versionCode 11
    versionName "1.11" 
}

buildTypes {
    release {
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.debug
    }

    debug {
        shrinkResources false
        minifyEnabled false
        signingConfig signingConfigs.debug
    }
}
buildToolsVersion '34.0.0'

} `

Error when I do flutter run --release, but when debug mode all runs normally.

I/flutter (24429): error notif init: PlatformException(SHARED_PREFERENCES_NOT_AVAILABLE, class p2.b isn't parameterized, sharedPreferences.get, null) I/flutter (24429): Lokaasi error: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648) I/flutter (24429): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334) I/flutter (24429): I/flutter (24429): #2 MethodChannelAwesomeNotifications.initialize (package:awesome_notifications/awesome_notifications_method_channel.dart:300)

Line 300 leads to this code: var result = await methodChannel.invokeMethod(CHANNEL_METHOD_INITIALIZE, { INITIALIZE_DEBUG_MODE: debug, INITIALIZE_DEFAULT_ICON: defaultIconPath, INITIALIZE_CHANNELS: serializedChannels, INITIALIZE_CHANNELS_GROUPS: serializedChannelGroups, BACKGROUND_HANDLE: dartCallbackReference!.toRawHandle() });

Sebuahhobi avatar Jun 20 '24 02:06 Sebuahhobi