Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: lStar not found issue when using onesignal_flutter: ^5.2.2 with Flutter SDK 3.24.0 due to compileSdkVersion 28 #930

Closed
2 of 3 tasks
sohyuyuan opened this issue Aug 9, 2024 · 33 comments

Comments

@sohyuyuan
Copy link

sohyuyuan commented Aug 9, 2024

What happened?

I am encountering a lStar not found issue when attempting to build my Flutter application in release mode using the onesignal_flutter: ^5.2.2 package. This issue occurs after upgrading to Flutter SDK 3.24.0.

Steps to reproduce?

1. Upgrade Flutter SDK to 3.24.0.
2. Create a Flutter project.
2. Add the onesignal_flutter: ^5.2.2 package to the pubspec.yaml file.
3. Attempt to build the APK in release mode using flutter build apk --release

What did you expect to happen?

The application should build successfully without any issues.

Proposed Solution:
To resolve this issue, the onesignal_flutter should update its Android build.gradle to utilise compileSdk 31 or higher.

OneSignal Flutter SDK version

Release 5.2.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

flutter build apk --release

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':onesignal_flutter:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/sohyuyuan/Documents/TestProject/test_firebase_auth/build/onesignal_flutter/intermediates/merged_res/release/values/values.xml:2657: AAPT: error: resource android:attr/lStar not found.



flutter doctor -v

[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-MY)
    • Flutter version 3.24.0 on channel stable at /Users/sohyuyuan/fvm/versions/3.24.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (9 days ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/sohyuyuan/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.92.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (3 available)            
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 127.0.6533.100
 
[✓] Network resources
    • All expected network resources are available.

• No issues found!

Code of Conduct

  • I agree to follow this project's Code of Conduct
@AnkitFlutterDev
Copy link

AnkitFlutterDev commented Aug 9, 2024

i am also facing this same issue in flutter latest version 3.24.0
i am upgrading my project which is i created around 18 month ago and change onesignal_flutter version 3.5.0 to 5.2.2,and also made some changes like
/*
OneSignal.shared.setAppId(oneSignalAppId);
OneSignal.shared
.promptUserForPushNotificationPermission()
.then((accepted) {});
*/
OneSignal.Debug.setLogLevel(OSLogLevel.verbose);
OneSignal.initialize(oneSignalAppId);
OneSignal.Notifications.requestPermission(true).then((accepted) {
debugPrint(" #####OneSignal Permission Accepted:$accepted #####");
});

android and ios both working fine in emulator/simulator and notification also working fine 
but whenever i tried to generate debug/release apk i got error same as like

* What went wrong:

Execution failed for task ':onesignal_flutter:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:/Users/ankitthummar/Desktop/fl_rc_supreme_web/build/onesignal_flutter/intermediates/merged_res/release/values/values.xml:2657: AAPT: error: resource android:attr/lStar not found.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

@anmolstuteja
Copy link

I'm facing the same issue.

@anmolstuteja
Copy link

There seems to be a issue with the latest flutter version 3.24.0 after downgrading to 3.22.3 it's working.

@EDnny12
Copy link

EDnny12 commented Aug 10, 2024

Same

@this-sunil
Copy link

Some developer update latest version update this dependecies

@sunilshedge
Copy link

  • What went wrong:
    Execution failed for task ':onesignal_flutter:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:D:\sunil\sanjeevani\build\onesignal_flutter\intermediates\merged_res\release\values\values.xml:2657: AAPT: error: resource android:attr/lStar not found.

@sunilshedge
Copy link

update compile sdk version compileSdkVersion 34

@sunilshedge
Copy link

main android folder group 'com.onesignal.flutter'
version '5.2.2'

buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:7.0.0'
}

}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 34
// Condition for namespace compatibility in AGP <4.2
if (project.android.hasProperty("namespace")) {
namespace 'com.onesignal.flutter'
}

defaultConfig {
    minSdkVersion 16
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
    disable 'InvalidPackage'
}

}

dependencies {
implementation 'com.onesignal:OneSignal:5.1.17'
}

@affan3699
Copy link

Facing Same Issue

@najiezzeldien
Copy link

Same Issue

1 similar comment
@haven-git
Copy link

Same Issue

@vagrantrobbie
Copy link

Same issue

@fadlialakbar
Copy link

Same issue here

@dllzar
Copy link

dllzar commented Aug 13, 2024

Same issue

@newselfDevops
Copy link

same issue

AtjonTV added a commit to dekoster-IT-Consulting-GmbH/flutter_onesignal that referenced this issue Aug 13, 2024
@ilyasarafathemvigo
Copy link

Same issue

@SergioQuinonez
Copy link

Same issue 😞

@sunilshedge
Copy link

please
update this plugin onesignal i will changes in file then run my project

@GeceGibi
Copy link

Any changes ?!?!?*1!?

@sohyuyuan
Copy link
Author

Add the code block below to the android/build.gradle file in your project directory.

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = "../build"
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    // Add this
    afterEvaluate {
        android {
            compileSdkVersion 34
        }
    }
    // End
}
subprojects {
    project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

The code is a Gradle configuration script used in Android projects. The subprojects block allows you to configure certain settings for all subprojects (modules) in the project. The afterEvaluate block contains code that will run after the initial configuration is completed, ensuring that all settings are fully read and evaluated before making any changes.

The android block defines Android-related configuration settings, and the compileSdkVersion 34 line ensures that projects are compiled with Android API 34. This is important for leveraging the latest API features on Android, as newer APIs generally offer better performance, security, and new features.

After implementing these changes, you should perform comprehensive testing throughout the entire project to ensure that everything functions as expected. Additionally, be mindful of potential side effects that might affect other dependencies in your project.

@sohyuyuan
Copy link
Author

This is a temporary solution. I still recommend that the OneSignal team upgrade the compile SDK version and perform a comprehensive evaluation of their package.

Add the code block below to the android/build.gradle file in your project directory.

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = "../build"
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    // Add this
    afterEvaluate {
        android {
            compileSdkVersion 34
        }
    }
    // End
}
subprojects {
    project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

The code is a Gradle configuration script used in Android projects. The subprojects block allows you to configure certain settings for all subprojects (modules) in the project. The afterEvaluate block contains code that will run after the initial configuration is completed, ensuring that all settings are fully read and evaluated before making any changes.

The android block defines Android-related configuration settings, and the compileSdkVersion 34 line ensures that projects are compiled with Android API 34. This is important for leveraging the latest API features on Android, as newer APIs generally offer better performance, security, and new features.

After implementing these changes, you should perform comprehensive testing throughout the entire project to ensure that everything functions as expected. Additionally, be mindful of potential side effects that might affect other dependencies in your project.

@najiezzeldien
Copy link

@sohyuyuan It work for me
Thank you

@AnkitFlutterDev
Copy link

AnkitFlutterDev commented Aug 16, 2024

onesignal_flutter: ^5.2.3 released
any one tried this one? and stil facing same issue?

@vagrantrobbie
Copy link

onesignal_flutter: ^5.2.3 released any one tried this one? and facing same issue?

Yep, I still receive the same error. I just tried to compile using onesignal_flutter: ^5.2.3 on Android but no fix.

@sohyuyuan has a solution so you can continue to build and release on Android but it would be great if the OneSignal team were able to fix properly

@rahulmukh1ya
Copy link

rahulmukh1ya commented Aug 21, 2024

I am facing the same issue. It started to occur after I upgraded the flutter version to 3.24.0. Also, I am currently using one signal version 5.2.3 (which happens to be the latest version as of writing this comment). The only solution I found is downgrading the flutter version.

@kleyber-ribeiro
Copy link

kleyber-ribeiro commented Aug 22, 2024

Same issue here and I'm using the version 5.2.3 of OneSignal and the (temporary) solution was from @sohyuyuan. In my case, I don't want to downgrade the Flutter version.

@this-sunil
Copy link

this-sunil commented Aug 23, 2024

Why updating your package if you doesn't getting permanent solution please update compilesdk version and targetsdk version 34 in your latest updates targetsdk 33 and compile sdk 34 this is reason your updating package doesn't work.please before testing then update your package so many developer use your plugin and updating flutter package

@Namr547
Copy link

Namr547 commented Aug 27, 2024

@sohyuyuan Thanks alot brother. yesterday i spent 15 hours in office but didn't solve the issue
now I just found you solution and it worked

@nextvisionmx
Copy link

Thanks @sohyuyuan !!

@jennantilla
Copy link
Contributor

Hello everyone! Thanks for your patience. This should be fixed in 5.2.4. Please let us know if there are any additional questions or concerns.

@this-sunil
Copy link

this-sunil commented Aug 30, 2024

Update gradle 7.0.0 in build.gradle could not parse pom com.android.tools:common:30.0.0 content not allowed in prolog . change below line
classpath 'com.android.tools.build:gradle:8.1.0'

@sohyuyuan
Copy link
Author

Closing the issue as version5.2.4 is no longer blocking me from building the Android APK.

Hello everyone! Thanks for your patience. This should be fixed in 5.2.4. Please let us know if there are any additional questions or concerns.

@this-sunil
Copy link

this-sunil commented Sep 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests