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

RDART-1087: Update compileSdkVersion to fix android:attr/lStar not found #1797

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

scris
Copy link
Contributor

@scris scris commented Sep 27, 2024

Pull request #1773 exists but was not merged for more than a month due to some configuration mistakes concerned by cla-bot, making #1774 unsolved for long.

This pull request includes exactly the same things of what #1773 included, aiming to speed up the merging of this important update, so that the "android:attr/lStar not found" error can be fixed when using Flutter SDK 3.24.

@Den-creator
Copy link

Is any update here ?

@Den-creator
Copy link

For those, who are looking for quick solution:

Add the following to the root-level android/build.gradle file:

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty("android")) {
            project.android {
                compileSdkVersion = 31
            }
        }
    }
}

Make flutter clean

@scris scris changed the title Update compileSdkVersion to fix android:attr/lStar not found RDART-1087: Update compileSdkVersion to fix android:attr/lStar not found Oct 6, 2024
Copy link

cla-bot bot commented Oct 6, 2024

Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA. Our records show that CLA has not been signed by @scris. Please submit your CLA electronically using our Google form so we can accept your submissions. After signing the CLA you can recheck this PR with a @cla-bot check comment. The GitHub usernames you file there will need to match that of your Pull Requests. If you have any questions or cannot file the CLA electronically, make a comment here and we will be happy to help you out.

@scris
Copy link
Contributor Author

scris commented Oct 6, 2024

@cla-bot check

@cla-bot cla-bot bot added the cla: yes label Oct 6, 2024
Copy link

cla-bot bot commented Oct 6, 2024

The cla-bot has been summoned, and re-checked this pull request!

@scris
Copy link
Contributor Author

scris commented Oct 8, 2024

Can you approve the workflows? Thank you. @nirinchev

@rsyd29
Copy link

rsyd29 commented Oct 10, 2024

Pull request #1773 exists but was not merged for more than a month due to some configuration mistakes concerned by cla-bot, making #1774 unsolved for long.

This pull request includes exactly the same things of what #1773 included, aiming to speed up the merging of this important update, so that the "android:attr/lStar not found" error can be fixed when using Flutter SDK 3.24.

i have change my package realm to your github url, but still not working. i have issue and error like this:

Unhandled exception:
PathNotFoundException: Creation failed, path = '/Users/laptop/.pub-cache/git/realm-dart-f0b9af27f7b6fa913c45f720107975ceb7a82887/packages/realm/android/src/main/cpp/lib' (OS Error: No such file or directory, errno = 2)
#0 _checkForErrorResponse (dart:io/common.dart:55:9)
#1 _Directory.create. (dart:io/directory_impl.dart:109:9)

#2 InstallCommand.downloadAndExtractBinaries (package:realm_dart/src/cli/install/install_command.dart:76:7)

#3 InstallCommand.run (package:realm_dart/src/cli/install/install_command.dart:154:5)

#4 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':realm:downloadRealmBinaries'.

Process 'command '/Users/laptop/fvm/versions/stable/bin/dart'' finished with non-zero exit value 255

  • 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.
Get more help at https://help.gradle.org.

BUILD FAILED in 22s
Error: Gradle task assembleDebug failed with exit code 1

@scris
Copy link
Contributor Author

scris commented Oct 11, 2024

I think "OS Error: No such file or directory" is probably fault on your computer's side, and flutter clean and redo your task might help. But I'm not sure, it might be some other faults I had never seen. If you're willing to solve this before the official merge, I think the best way is to use the workaround from @Den-creator rather than pulling from my branch. Best regard.

@MinuteReversal
Copy link

MinuteReversal commented Oct 21, 2024

For those, who are looking for quick solution:

Add the following to the root-level android/build.gradle file:

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty("android")) {
            project.android {
                compileSdkVersion = 31
            }
        }
    }
}

Make flutter clean

Thank you for the configuration @Den-creator

The name of the project I specified used version 31 most, and it was finally compiled.(Specify that the mob library uses 31 SDK)

buildscript {
    ext.kotlin_version = '1.8.0'
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://mvn.mob.com/android"
        }
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.mob.sdk:MobSDK2:+"
        classpath 'com.google.gms:google-services:4.3.14'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://mvn.mob.com/android" }
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty("android")) {
            project.android {
                // Specify that the mob library uses 31 SDK
                if (project.name.contains("mob")) {
                    compileSdkVersion 31
                    buildToolsVersion "31.0.0"
                } else {
                    compileSdkVersion 34
                    buildToolsVersion "34.0.0"
                }
            }
        }
    }
}

subprojects {
    project.evaluationDependsOn(':app')
}

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

@nirinchev nirinchev merged commit 4e23227 into realm:main Oct 21, 2024
23 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants