yagnik2411 / Quiz-Genius

Introducing Quiz Genius: The ultimate Flutter quiz app with Firebase authentication, dynamic quizzes, real-time feedback, and personalized profiles. Join now to test your knowledge, track progress, and challenge friends. Clone, customize, and conquer quizzes. Start your intellectual adventure today!
https://play.google.com/store/apps/details?id=com.yagnik.quiz_genius
Mozilla Public License 2.0
15 stars 31 forks source link

[BUG] GitHub actions errors #86

Open KirolosMFahem opened 3 days ago

KirolosMFahem commented 3 days ago

while reviewing the PR I found that GitHub get me error that

and here's an example for PR 83 I got this error from Github CI

The failure occurred due to the following errors in the lib/utils/profile_image_service.dart file:

  1. URI Doesn't Exist:

    • The import statement for flutter/material.dart has an extra space which makes it invalid.
      import 'package:flutter/material.dart ';
  2. Undefined Identifiers:

    • The identifier Colors is undefined. This is due to the incorrect import statement mentioned above.

Recent Changes

The recent commit that affected this file was:

Suggested Fixes

  1. Correct the import statement for flutter/material.dart by removing the extra space:

    import 'package:flutter/material.dart';
  2. Ensure that the Colors class is properly referenced by fixing the import statement.

By correcting the import statement, the identifier Colors will be recognized, and the errors should be resolved.

vijaykarthiktk commented 3 days ago

lemme check

KirolosMFahem commented 2 days ago

new error message

Analysis of Error

The error in the logs indicates that the Android Gradle plugin requires Java 17, but the current environment is using Java 12. Here is the relevant log message:

Android Gradle plugin requires Java 17 to run. You are currently using Java 12.
Your current JDK is located in /opt/hostedtoolcache/jdk/12.0.2/x64

Steps to Fix the Issue

  1. Update the Java Version in the CI/CD Pipeline:
    • Modify the GitHub Actions workflow file to use Java 17 instead of Java 12.

Example Update to GitHub Actions Workflow

Here is an example of how you can update the workflow file to use Java 17:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Set up JDK 17
        uses: actions/setup-java@v2
        with:
          java-version: '17'
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build with Gradle
        run: ./gradlew build

Summary

The failure is due to the Android Gradle plugin requiring Java 17. Updating the GitHub Actions workflow to use Java 17 should resolve the issue.