greenDAO icon indicating copy to clipboard operation
greenDAO copied to clipboard

Gradle Build error with GitHub Actions

Open aditmodhvadia opened this issue 4 years ago • 1 comments

Getting an error for DaoSession and DaoMaster is not found when Android CI GitHub action is triggered for a project. I also added ./gradlew greendao before the build command to be sure but it still gives the error. Although it builds successfully on local.

Note: One of the entities uses oneTo relation with Join on others, so it contains DaoSession, and that import also gives the error.

Android CI:

name: Android CI

on:
  push:
    branches: [ master, release, develop ]
  pull_request:
    branches: [ master, release, develop ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build GreenDao Files
      run: ./gradlew greendao
    - name: Build with Gradle
      run: ./gradlew build

Error:

/home/runner/work/iSolationAlert/iSolationAlert/app/src/main/java/edu/bu/metmobile/isolationalert/database/DaoHelper.java:51: error: cannot find symbol DaoMaster daoMaster = new DaoMaster(db); ^ symbol: class DaoMaster location: class DaoHelper

aditmodhvadia avatar Jun 02 '20 21:06 aditmodhvadia

Are you using Android Studio to build locally? Or actually the same ./gradlew build command? I guess there must be some difference regarding dependency configurations.

greenrobot-team avatar Jun 22 '20 06:06 greenrobot-team