Project compile fine in groovy and when I converted to DSL it fails to build due to Apollo
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:generateServiceApolloSources'.
> Apollo: specify 'packageName':
apollo {
packageName.set("com.example")
// Alternatively, if you're migrating from 2.x, you can keep the 2.x
// behaviour with `packageNamesFromFilePaths()`:
packageNamesFromFilePaths()
}
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:68)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:51)
at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:195)
...
My script before had this
apollo {
service("apollo") {
packageNamesFromFilePaths("com.mine.android.apollo")
sourceFolder.set("com/mine/android/apollo")
customTypeMapping = [
"Decimal" : "kotlin.Double"
]
}
}
Now it has this after converting to DSL
apollo {
service("apollo") {
packageNamesFromFilePaths("com.mine.android.apollo")
sourceFolder.set("com/mine/android/apollo")
customTypeMapping.set(
mapOf("Decimal" to "kotlin.Double")
)
}
}
And this fails the build with the above
Please help. not familiar with Apollo and documentation is not good and does not work.