Android Gradle - Gitlab CI - Docker - CMake - NullPointerException - nullpointerexception

I'm trying to get simple Android Unit Tests to run on Gitlab CI, but I'm having troubles getting things to build correctly in the CI Docker image. I have the master project which pulls from a Library project. The Library has C code in it, so I need to use CMake to get it to build. All of this is working locally on my windows machine when using Android Studio. However, once I move to the CI server, things break with the following error:
Using incremental javac compilation for :Library debug.
Incremental java compilation is an incubating feature.
Checking the license for package CMake 3.6.3155560 in /android-sdk-linux/licenses
License for package CMake 3.6.3155560 accepted.
Preparing "Install CMake 3.6.3155560 (revision: 3.6.3155560)".
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" ready.
Finishing "Install CMake 3.6.3155560 (revision: 3.6.3155560)"
Installing CMake 3.6.3155560 in /android-sdk-linux/cmake/3.6.3155560
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" complete.
"Install CMake 3.6.3155560 (revision: 3.6.3155560)" finished.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Library'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':Library'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
...
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NullPointerException
at com.android.builder.sdk.DefaultSdkLoader.installSdkTool(DefaultSdkLoader.java:572)
at com.android.build.gradle.internal.SdkHandler.installCMake(SdkHandler.java:302)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.create(ExternalNativeJsonGenerator.java:628)
at com.android.build.gradle.internal.TaskManager.createExternalNativeBuildJsonGenerators(TaskManager.java:1241)
at com.android.build.gradle.internal.LibraryTaskManager.lambda$createTasksForVariantData$11(LibraryTaskManager.java:240)
...
at com.sun.proxy.$Proxy15.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82)
... 56 more
BUILD FAILED
Total time: 1 mins 25.384 secs
Stopped 0 worker daemon(s).
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':Library'.] from daemon DaemonInfo{pid=39, address=[1f3b75f9-7080-48b5-b298-0e6136640a0a port:41964, addresses:[/127.0.0.1]], state=Busy, lastBusy=1496784783851, context=DefaultDaemonContext[uid=0e3eadf0-a7bd-4ede-9eb8-0c2a96ebef58,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/root/.gradle/daemon,pid=39,idleTimeout=10800000,daemonOpts=-Xmx1536m,-Dfile.encoding=UTF-8,-Duser.country,-Duser.language=en, -Duser.variant]} (build should be done).
ERROR: Job failed: exit code 1
Judging by the line
Caused by: java.lang.NullPointerException
at com.android.builder.sdk.DefaultSdkLoader.installSdkTool(DefaultSdkLoader.java:572)
at com.android.build.gradle.internal.SdkHandler.installCMake(SdkHandler.java:302)
it looks like it is a problem with the CMake. But it looks like it is installed and the licence is accepted as noted by the output at the start of that block above.
Can anyone give me some pointers on what is the problem?
* Is it that gradle doesn't know where CMake was installed?
* Is it a problem perhaps with the NDK?
* Or perhaps where I can find the source code for com.android.build.gradle.internal.SdkHandler.installCMake and com.android.builder.sdk.DefaultSdkLoader.installSdkTool.
My searches have been unfruitful.
I can provide more about my setup upon request. (i.e. android project, docker image, gitlab-ci.yml, etc.)

Well, mbertin commented on Feb 2 at here that by using a lower gradle build tool, it solved the problem for him. (i.e. classpath 'com.android.tools.build:gradle:2.2.2).
After giving it an attempt, my build script got passed that error! (anyone know why?)
Thanks for the emotional support Stack Overflow! You are the best!

Related

Forge 1.7.10 : Error while "gradlew setupDecompWorkspace"

I was trying to setup my modding environement and when i did 'gradlew setupDecompWorkSpace', this happen :
WARNING: You are using an unsupported version of ForgeGradle.
Please consider upgrading to ForgeGradle 4 and helping in the efforts to get old versions working on the modern toolchain.
See https://gist.github.com/TheCurle/fe7ad3ede188cbdd15c235cc75d52d4a for more info on contributing.
#################################################
ForgeGradle 1.2.2-g2ea0336
https://github.com/MinecraftForge/ForgeGradle
#################################################
Powered by MCP unknown
http://modcoderpack.com
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
#################################################
:extractMcpData UP-TO-DATE
:getVersionJson
Unexpected reponse 403 from http://s3.amazonaws.com/Minecraft.Download/versions/1.7.10/1.7.10.json
:extractUserDev UP-TO-DATE
:genSrgs SKIPPED
:extractNatives UP-TO-DATE
:getAssetsIndex
Unexpected reponse 403 from https://s3.amazonaws.com/Minecraft.Download/indexes/1.7.10.json
:getAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':getAssets'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.862 secs
C:\Users\Dimitri\eclipse-workspace\forge-1.7.10-10.13.4.1614-1.7.10-src>
I've tried to change the gradle version into the gradle-wrapper.properties from 2.0 to 2.6, It just lasted longer.
I'm not a professional in this but my workaround when I had this problem was replacing forge gradle with anatawa12's fork. I think what happened was some urls changed in one of the forge updates and forge 1.7.10 wasn't considered in the change.
New gradle: https://github.com/anatawa12/ForgeGradle-1.2
How to fix the Problem Method 1:
Follow: https://github.com/anatawa12/ForgeGradle-example#how-to-replace-forgegradle-12-with-anatawa12s-fork
Edit Gradle wrapper to use gradle 4.4.1 or higher.
How to fix the Problem Method 2:
Download and use anatawa12's example gradle template (same commands for cmd):
https://github.com/anatawa12/ForgeGradle-example/archive/master.zip

React-native yarn android #homee/react-native-mapbox-navigation Execution failed for task ':homee_react-native-mapbox-navigation:compileDebugKotlin'

I have installed node package #homee/react-native-mapbox-navigation for quick turn-by-turn navigation in my react-native android app, but when I run yarn android, got below error:
> Configure project :homee_react-native-mapbox-navigation
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Task :homee_react-native-mapbox-navigation:compileDebugKotlin
> Task :homee_react-native-mapbox-navigation:compileDebugKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
72 actionable tasks: 2 executed, 70 up-to-date
e: /home/cipto/Code/mapbox/mapboxnav/node_modules/#homee/react-native-mapbox-navigation/android/src/main/java/com/homee/mapboxnavigation/MapboxNavigationManager.kt: (11, 19): Unresolved reference: maps
.
.
.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':homee_react-native-mapbox-navigation:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
have been following the gude in readme at https://github.com/homeeondemand/react-native-mapbox-navigation, by the way I installed the package which come from the github (latest version 2.00 master branch) by running this:
yarn add homeeondemand/react-native-mapbox-navigation#master
I have also try that package and got the same error, after I upgrade the kotlin version into 1.6.0, the error went away.

react native - could not resolve all dependencies for configuration ':classpath'

I was working on my react native app, when suddenly there was a Javascript React versions mismatch.
When I searched around for a way to fix it, someone suggested to call the command react-native upgrade
After running the command, it completely reset my android app package. I had to do react-native install <my-react-native-packages> for all libraries that I had included as I couldn't find another way to do so.
After doing so, this is the error I'm receiving upon calling react-native run-android
Scanning folders for symlinks (9ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'CustomApp'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.1.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.jar
Required by:
:CustomApp:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Additional error with --stacktrace
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'CustomApp'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:57)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':classpath'.
at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:62)
at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyConfigurationResolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDependencyConfigurationResolver.java:112)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingConfigurationResolver.java:189)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:669)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:293)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:69)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:186)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:75)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:157)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
... 43 more
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:3.1.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.jar
Required by:
:CustomApp:unspecified
at org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(DefaultBuildableComponentResolveResult.java:38)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:88)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:59)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$ComponentMetaDataResolverChain.resolve(ComponentResolversChain.java:80)
at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:44)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java:564)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.java:574)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:260)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:234)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:141)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:79)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver$1.execute(DefaultArtifactDependencyResolver.java:90)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver$1.execute(DefaultArtifactDependencyResolver.java:80)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:39)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:80)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:41)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:192)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:187)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:64)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:39)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:91)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyConfigurationResolver.resolve(SelfResolvingDependencyConfigurationResolver.java:40)
at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolve(ShortCircuitEmptyConfigurationResolver.java:52)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolve(ErrorHandlingConfigurationResolver.java:43)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:372)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:347)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:340)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:667)
... 53 more
BUILD FAILED
I have no idea how to resolve this or undo this. Can anyone suggest something to fix this problem?
Can you try this below (for react-native version <0.60).
Delete android, ios and node modules folder
run > npm install /to get the node modules folder
> react-native upgrade //to get both android and ios folder
> react-native link //to link the libraries
> react-native run-android/run-ios
Sounds like an issue with your app's build.gradle file where it's using an old version of the gradle build tools.
I would recommend opening up your project in Android Studio and then open up the projects's build.gradle file located here: RN-Project/android/build.gradle
You'll find the gradle tools version within buildscript and it'll look something like this.
buildscript {
repositories {
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'de.undercouch:gradle-download-task:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
If it is outdated, it'll highlight the com.android.tools.build:gradle:2.2.2 part and suggest what build tools version you should update to. Hopefully after updating it, it should work.
In my case, I just disconnected my office proxy and it started working. May be my office proxy was blocking some url's.
Make Sure you have done the following things:
Install Android Studio
Install the Android SDK
Configure the ANDROID_HOME environment variable
visit https://facebook.github.io/react-native/docs/getting-started.html to get the proper guideline

Adding sub module to project causing gradle build failures in Android studio 3.0 with gradle version 4.1

I added sub module library vertical-stepper-form version 0.9.8, while I set dependency of this library on my app module. I was able to do it successfully.
I am using Android Studio 3.0 with gradle version 4.1, few of the classes in project are in kotlin and others in java
When I started gradle sync it gave me this error. The gradle is not building and showing below issues :
/*********************************/
Information:Gradle tasks [:vertical-stepper-form:generateDebugSources,
:vertical-stepper-form:generateDebugAndroidTestSources,
:vertical-stepper-form:mockableAndroidJar,
:app:generateInstallDebugSources,
:app:generateInstallDebugAndroidTestSources, :app:mockableAndroidJar]
D:\Devavrata\project/package/src/main/res/abc.xml Error:error:
attribute 'com.spireon.install:src' not found.
D:\Devavrata\AbcProject\abc-Android\app\build\intermediates\incremental\mergeInstallDebugResources\stripped.dir\layout\activity_main.xml
Error:attribute 'com.spireon.install:src' not found. Error:failed
linking file resources. Error:java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details Error:java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error:
check logs for details Error:Execution failed for task
':app:processInstallDebugResources'.
Failed to execute aapt Information:BUILD FAILED in 24s Information:7 errors Information:0 warnings Information:See complete output in
console
/********************************/
What I have already tried :
I tried with changing import lines in xml also changing the android:src and srcCompat properties. Along with build/project cleaning and invalidating the cache.
Changing this line in gradle.properties
android.enableAapt2=false
Let me know if anyone has faced this issue

BuildException when executing Ant task

I have installed Apache Ant and set the correctly the Path, CLASS_PATH and ANT_PATH variables. When I run a jar task in a command line within my project folder where the build.xml file is, I get the following error:
BUILD FAILED
C:\Documents and Settings\TonyS\My Documents\My Workspace\code\build.xml: 32:
The following error occurred while executing this line:
jar:file:/C:/Documents%20and%20Settings/TonyS/My%20Documents/Ant/apache-ant-1.8.1/lib/ant.jar!org/apache/tools/ant/antlib.xml:37: Could not create task or type: componentdef.
Ant could not find the task or a class this task relies upon.
I had this error and found it was caused by having an older version of ant.jar in the classpath.
One possibility is you may have another version of ant installed on your system and your PATH pointing to it.
Check what is ANT_HOME set to.
Run ant -version and see if it shows up 1.8.1
Add the following config in ~/.bashrc
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Don't forget source ~/.bashrc
Hope useful for you!
you have duplicate ant in your environment.
My case was:
I am using 1.9.7 ant, but ant -version gave me 1.7.1
I installed weblogic and it has 1.7.1 ant, after rename MW_HOME, the issue was gone.
I found this while I was using 1.7.1 to test junit. it shows a warning.
junit:
[junit] WARNING: multiple versions of ant detected in path for junit
[junit] jar:file:/D:/wls12120/oracle_common/modules/org.apache.ant_1.7.1/lib/ant.jar!/org/apache/tools/ant/
Project.class
[junit] and jar:file:/D:/apache-ant-1.7.1/lib/ant.jar!/org/apache/tools/ant/Project.class
[junit] Running HelloWorldTest