Execution failed for task ‘:package_info_plus:compileReleaseJavaWithJavac’. Only happening on bitrise build

I have found many questions related to this issue. The difference here is that this error only happens on bitrise build.

I can build locally release and development mode, and the build works, that is why I am thinking if maybe it could have to do with the bitrise configuration.

The full error is

Execution failed for task ':package_info_plus:compileReleaseJavaWithJavac'.
> error: invalid source release: 17

(I am not using this package_info_plus directly, it must be a dependency in one of the libraries)

What I have tried

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

builds locally, does not build on bitrise

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = '17'
}

does not build on bitrise, did not try locally

My flutter version is 3.22.2 stable, windows for local machine and macos for bitrise

Edit: So it seems to me that none of these changes in my build.gradle will have any effect if the issue is within the package_info_plus. The only library which I use that uses this package is sentry. So I tried downgrading sentry to the version I had before but I am still having the issue.

Any help is appreciated.

This behaviour happens because of package_info_plus‘s android configuration. Both Kotlin and Java targets are set to 17. This setting means that compiler will produce class files suitable for 17 version of JDK. Of course, JDK 11 (in case of default on bitrise) knows nothing about JDK 17.

Unfortunately, there is not much you can do only with build.gradle configuration since these settings do not override each other.

Now, Bitrise part of the question. As per documentation, default JDK version on bitrise builders is 11. Good news is it is possible to set JDK to 17. Here is what you need to do:

In your bitrise.yaml you have to add these configuration, before any android-related steps:

primary:
  steps:
  - set-java-version@1:
      inputs:
      - set_java_version: '17'

Hope this will help resolve your issue

New contributor

Sameri11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

0

Double-Check build.gradle: Ensure your project’s build.gradle file (both app-level and module-level) has the following compileOptions and kotlinOptions (if using Kotlin)

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = '17'
}
  • Check the JDK: Verify the installed JDK version on your Bitrise virtual machine (VM). The error suggests it might be an older version that doesn’t support Java 17.

  • Update JDK (if needed): If the JDK is outdated, update it to a version that supports Java 17 (e.g., OpenJDK 17 or newer).

  • Set JAVA_HOME: Ensure the JAVA_HOME environment variable on the Bitrise VM points to the correct JDK installation directory.

0

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật