Build failed with error: cannot find symbol

Bitrise Build Issue Report template

Description of the issue

Build failed with error cannot find symbol at import statement
import com.abc.def.MyFile;

Please describe the issue here
My project has multiple product flavours. (Ex:- flavour1, flavour2, flavour3, flavour4)
I have a Java file(MyFile.java), which are specific to product flavour, so I keep each copy of this file in different flavours source code. But not in main source code folder.

https://developer.android.com/studio/build/build-variants.html
Note: For a given build variant, Gradle throws a build error if it encounters two or more source set directories that have defined the same Java class. For example, when building a debug APK, you cannot define both src/debug/Utility.java and src/main/Utility.java. This is because Gradle looks at both these directories during the build process and throws a ‘duplicate class’ error. If you want different versions of Utility.java for different build types, you can have each build type define its own version of the file and not include it in the main/ source set.

Environment:

Where did the issue happen?

If on Bitrise.io: which stack? If not on Bitrise.io: on what operating system? (Plus any other information you can share)

Which build Step causes the issue and which version of the step?

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : YES/NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : YES/NO
  • If you have multiple different build configurations (workflows), does the issue affect all/more than one? : YES/NO
  • If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds) :
  • Does upgrading the build Step to the latest version help? : YES/NO
  • When did the issue start? :

Linux/Android stack builds

Can it be reproduced by running the build locally, after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/ .

Other stacks

Can it be reproduced by running the build locally with our CLI ( https://www.bitrise.io/cli ), after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )?

Build log

Please attach the build log (you can download the build log from the build’s page, once the build is finished, using the “Download log” button - floating at the bottom right corner of the log viewer), or if you can’t attach the whole log then send the full log through a private channel (e.g. email - https://www.bitrise.io/contact ), with a link to the related GitHub issue.

Can you please include the build’s log or the URL of the build?

Closing as we did not receive the build log yet as far as I know.

@annada if you’d need further assistance please create a new report (can be a copy of this one, or just link this one) but please provide the build log! :slight_smile:

Happy Building! :slight_smile: