Skip to content

Updated build.yml and build.gradle to fix some recent errors #74

Closed
withlimon wants to merge 0 commit into
Bigfoot71:masterfrom
withlimon:master
Closed

Updated build.yml and build.gradle to fix some recent errors #74
withlimon wants to merge 0 commit into
Bigfoot71:masterfrom
withlimon:master

Conversation

@withlimon
Copy link
Copy Markdown

First of all,I am sorry to pull a request mistakenly which edited gradle.properties.So, I closed that request.Then, I have deleted that forked repository and again forked the repository,so that gradle.properties not change.

build.gradle

I have added this to app/build.gradle inside the android { } block:

android {
    lint {
        baseline = file("lint-baseline.xml")
        abortOnError false 
    }
    // other configs
}

It will solve this below error in GitHub Action (It happens when app.application_id is changed in gradle.properties):

Lint found 1 errors, 7 warnings. First failure:

D:\a\raymob\raymob\app\src\main\AndroidManifest.xml:30: Error: Class referenced in the manifest, com.raylib.ra.NativeLoader, was not found in the project or the libraries [MissingClass]
            android:name=".NativeLoader"
                          ~~~~~~~~~~~~~

   Explanation for issues of type "MissingClass":
   If a class is referenced in the manifest or in a layout file, it must also
   exist in the project (or in one of the libraries included by the project.
   This check helps uncover typos in registration names, or attempts to rename
   or move classes without updating the XML references properly.

   https://developer.android.com/guide/topics/manifest/manifest-intro.html


The full lint text report is located at:
  D:\a\raymob\raymob\app\build\intermediates\lint_intermediate_text_report\debug\lintReportDebug\lint-results-debug.txt

[Incubating] Problems report is available at: file:///D:/a/raymob/raymob/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.

* What went wrong:
118 actionable tasks: 118 executed
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or create a baseline to see only new errors.
  To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:
  ```
  android {
      lint {
          baseline = file("lint-baseline.xml")
      }
  }
  ```
  For more details, see https://developer.android.com/studio/write/lint#snapshot
  
  Lint found 1 errors, 7 warnings. First failure:
  
  D:\a\raymob\raymob\app\src\main\AndroidManifest.xml:30: Error: Class referenced in the manifest, com.raylib.ra.NativeLoader, was not found in the project or the libraries [MissingClass]
              android:name=".NativeLoader"
                            ~~~~~~~~~~~~~
  
     Explanation for issues of type "MissingClass":
     If a class is referenced in the manifest or in a layout file, it must also
     exist in the project (or in one of the libraries included by the project.
     This check helps uncover typos in registration names, or attempts to rename
     or move classes without updating the XML references properly.
  
     https://developer.android.com/guide/topics/manifest/manifest-intro.html
  
  
  The full lint text report is located at:
    D:\a\raymob\raymob\app\build\intermediates\lint_intermediate_text_report\debug\lintReportDebug\lint-results-debug.txt

* 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 3m 45s
Error: Process completed with exit code 1.

build.yml

I have also updated Github Workflow File build.yml. I have updated java version to 17 and added this before gradle build command:

- name: Build project
run: |
          chmod +x ./gradlew
          ./gradlew updateLintBaseline
          ./gradlew build

So Now build.yml is look like:

name: Build

on:
  workflow_dispatch:
  push:
    branches:
      - master
    tags:
      - '*'
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v5
        with:
          submodules: true

      - name: Set up Java
        uses: actions/setup-java@v5
        with:
          java-version: '17'
          distribution: 'temurin'

      - name: Set up CMake
        uses: jwlawson/actions-setup-cmake@v2
        with:
          cmake-version: '3.30.3'

      - name: Build project
        run: |
          chmod +x ./gradlew
          ./gradlew updateLintBaseline
          ./gradlew build

      - name: Upload debug APKs
        uses: actions/upload-artifact@v4
        with:
          name: debug-apks
          path: ./app/build/outputs/apk/debug/*.apk

      - name: Upload release APKs
        uses: actions/upload-artifact@v4
        with:
          name: release-apks
          path: ./app/build/outputs/apk/release/*.apk

I am ensuring that I have tested this and confirmed that no errors will happened due to this pull request.
Thanks.

Comment thread .github/workflows/build.yml
Comment thread app/build.gradle
android {
namespace project.properties['app.application_id']
compileSdk 34

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint runs as part of the :app:lintDebug task, and it runs before preBuild finishes patching the files or in a separate task graph that doesn't trigger preBuild at the right time on the runner.
So,It must be fixed

@withlimon withlimon closed this Mar 27, 2026
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

Successfully merging this pull request may close these issues.

1 participant