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 report] Compile error on Android 15 (API 35) #1176

Closed
YanhqZ opened this issue Aug 28, 2024 · 2 comments · Fixed by #1177
Closed

[Bug report] Compile error on Android 15 (API 35) #1176

YanhqZ opened this issue Aug 28, 2024 · 2 comments · Fixed by #1177

Comments

@YanhqZ
Copy link
Contributor

YanhqZ commented Aug 28, 2024

Version

3.2.3

Platforms

Android

Device Model

Galaxy S22(Android14)

flutter info

[!] Flutter (Channel [user-branch], 3.22.3, on macOS 14.4.1 23E224 darwin-arm64,
    locale zh-Hans-CN)
    ! Flutter version 3.22.3 on channel [user-branch] at
      /Users/yhq/Documents/Flutter_SDK_COPY/Flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an
      official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions
      at https://flutter.dev/docs/get-started/install.
    ! Upstream repository unknown source is not the same as FLUTTER_GIT_URL
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] Android Studio (version 2024.1)
[!] Android Studio (version unknown)
    ✗ Unable to determine Android Studio version.
[✓] IntelliJ IDEA Community Edition (version 2022.3.3)
[✓] VS Code (version 1.77.3)
[✓] Connected device (5 available)            
[✓] Network resources

How to reproduce?

I upgrade my compile SDK to 35,then raising a compile error for kotlin nullability when I run project.

Logs

e: file:///Users/yhq/.pub-cache/hosted/pub.dev/photo_manager-3.2.3/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:55:48 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Array<(out) String!>?

Example code (optional)

app/build.gradle

android {
    namespace "..."
    compileSdk 35
    ndkVersion flutter.ndkVersion

    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

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

    defaultConfig {
        applicationId "..."
        minSdkVersion 21
        targetSdkVersion 35
        versionCode flutterVersionCode
        versionName flutterVersionName
        multiDexEnabled = true
    }

    //...
}

Contact

No response

@AlexV525
Copy link
Member

We don't support API 35 at this moment. You may consider updating the code yourself since it looks like a small fix.

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

Successfully merging a pull request may close this issue.

3 participants
@AlexV525 @YanhqZ and others