Issue
I have configured 2 product flavors and I have few files customized as per specific product flavors, and common files are in main. I can build the project using command line and using Android studio. While I use Jenkin to build the project it reports compilation error and expecting the product flavor specific file to be present inside the main. Why is this different behavior? Elaborated the problem below:
src/flavorA/java/MyFragment
src/flavorB/java/MyFragment
src/main/java/MainActivity
gradlew clean build, this is building fine with command line and Android Studio
While Jenkin reports error as
> Task :test-apps:compileClientAppDebugJavaWithJavac FAILED
/opt/jenkins_home/workspace/A-9807/app/src/main/java/com/example/sampleapp/HomePagerAdapter.java:8 error: cannot find symbol
import com.example.sampleapp.MyFragment;
Solution
Finally, I got the root cause, my Jenkins machine is the Linux one and the file system in Linux is case sensitive. While my local machine has Windows and I had defined the product flavors in camelCase while actually created directories for flavors in PascalCase
Answered By - SAR
Answer Checked By - Marilyn (JavaFixing Volunteer)