Moodle for mobile

"compileSdkVersion is not specified" when running cordova run android

 
Picture of Dhammika Dolawattha
"compileSdkVersion is not specified" when running cordova run android
 

I tried to setup using

https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2

As in the bottom of this page, I tried to " If you now want to install that app in a real device you can run "cordova run android

gave "FAILURE: Build failed with an exception" as follows

Please help me to correct these erros. thanks


C:\moodlemobiledirectory>cordova run android

Android Studio project detected

ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_181

studio

Subproject Path: CordovaLib

Subproject Path: app

publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.

java.lang.IllegalStateException: compileSdkVersion is not specified.

        at com.google.common.base.Preconditions.checkState(Preconditions.java:456)

        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:590)

        at com.android.build.gradle.BasePlugin.lambda$null$3(BasePlugin.java:555)

        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)

        at com.android.build.gradle.BasePlugin.lambda$createTasks$4(BasePlugin.java:551)

        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)

        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)

        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)

        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)

        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)

        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)

        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)

        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)

        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)

        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)

        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)

        at com.sun.proxy.$Proxy24.afterEvaluate(Unknown Source)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:75)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:69)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)

        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)

        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:651)

        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:133)

        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)

        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)

        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)

        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:246)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:165)

        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:124)

        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:107)

        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)

        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)

        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)

        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)

        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)

        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)

        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)

        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)

        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)

        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)

        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:45)

        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)

        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)

        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)

        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:71)

        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)

        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)

        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)

        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)

        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)

        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)

        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)

        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)

        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)

        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)

        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)

        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:58)

        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:33)

        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)

        at org.gradle.util.Swapper.swap(Swapper.java:38)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)

        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)

        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)

        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

        at java.lang.Thread.run(Thread.java:748)


FAILURE: Build failed with an exception.


* Where:

Script 'C:\moodlemobiledirectory\platforms\android\phonegap-plugin-push\moodlemobile-push.gradle' line: 6


* What went wrong:

A problem occurred evaluating script.

> C:\moodlemobiledirectory\platforms\android\app\AndroidManifest.xml (The system cannot find the file specified)


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


* Get more help at https://help.gradle.org


BUILD FAILED in 3s

(node:10132) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:

Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.

java.lang.IllegalStateException: compileSdkVersion is not specified.

        at com.google.common.base.Preconditions.checkState(Preconditions.java:456)

        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:590)

        at com.android.build.gradle.BasePlugin.lambda$null$3(BasePlugin.java:555)

        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)

        at com.android.build.gradle.BasePlugin.lambda$createTasks$4(BasePlugin.java:551)

        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)

        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)

        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)

        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)

        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)

        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)

        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)

        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)

        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)

        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)

        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)

        at com.sun.proxy.$Proxy24.afterEvaluate(Unknown Source)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:75)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:69)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)

        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)

        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:651)

        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:133)

        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)

        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)

        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)

        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:246)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:165)

        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:124)

        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:107)

        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)

        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)

        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)

        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)

        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)

        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)

        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)

        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)

        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)

        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)

        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)

        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)

        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:45)

        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)

        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)

        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)

        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:71)

        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)

        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)

        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)

        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)

        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)

        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)

        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)

        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)

        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)

        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)

        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)

        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:58)

        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:33)

        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)

        at org.gradle.util.Swapper.swap(Swapper.java:38)

        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)

        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)

        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)

        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)

        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

        at java.lang.Thread.run(Thread.java:748)


FAILURE: Build failed with an exception.


* Where:

Script 'C:\moodlemobiledirectory\platforms\android\phonegap-plugin-push\moodlemobile-push.gradle' line: 6


* What went wrong:

A problem occurred evaluating script.

> C:\moodlemobiledirectory\platforms\android\app\AndroidManifest.xml (The system cannot find the file specified)


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


* Get more help at https://help.gradle.org


BUILD FAILED in 3s

    at ChildProcess.whenDone (C:\moodlemobiledirectory\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)

    at emitTwo (events.js:126:13)

    at ChildProcess.emit (events.js:214:7)

    at maybeClose (internal/child_process.js:925:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

(node:10132) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:10132) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


C:\moodlemobiledirectory>

 
Average of ratings: -
Picture of Dani Palou
Re: "compileSdkVersion is not specified" when running cordova run android
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

I moved your post to a new discussion because it's not strictly related to the other discussion.

Try this:

https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#ERROR:_In_.3Cdeclare-styleable.3E_FontFamilyFont.2C_unable_to_find_attribute_android:font

Kind regards,

Dani

 
Average of ratings: -
Picture of Dhammika Dolawattha
Re: "compileSdkVersion is not specified" when running cordova run android
 

Dear Mr. Dani,

Thanks for reply. But still not successful.

After doing what you asked, it is showing less number of lines for "codova run android". 

Please see showing lines.

(Please note : Build file 'C:\moodlemobiledirectory\platforms\android\build.gradle' line: 56.

here line 56 mean, the starting place the new code which you asked to add in build.gradle file.)


C:\moodlemobiledirectory>cordova run android

Android Studio project detected

ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_181

studio

Subproject Path: CordovaLib

Subproject Path: app


FAILURE: Build failed with an exception.


* Where:

Build file 'C:\moodlemobiledirectory\platforms\android\build.gradle' line: 56


* What went wrong:

A problem occurred evaluating root project 'android'.

> Could not find method android() for arguments [build_5hxwg7v879gavhucvgsqu2d9x$_run_closure3@6fa81776] on root project 'android' of type org.gradle.api.Project.


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


* Get more help at https://help.gradle.org


BUILD FAILED in 2s

(node:2460) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:

FAILURE: Build failed with an exception.


* Where:

Build file 'C:\moodlemobiledirectory\platforms\android\build.gradle' line: 56


* What went wrong:

A problem occurred evaluating root project 'android'.

> Could not find method android() for arguments [build_5hxwg7v879gavhucvgsqu2d9x$_run_closure3@6fa81776] on root project 'android' of type org.gradle.api.Project.


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


* Get more help at https://help.gradle.org


BUILD FAILED in 2s

    at ChildProcess.whenDone (C:\moodlemobiledirectory\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)

    at emitTwo (events.js:126:13)

    at ChildProcess.emit (events.js:214:7)

    at maybeClose (internal/child_process.js:925:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

(node:2460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:2460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


C:\moodlemobiledirectory>

 
Average of ratings: -
Picture of Dani Palou
Re: "compileSdkVersion is not specified" when running cordova run android
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

it's the first time I see that an error and it looks quite weird :/

Try searching in Google, hopefully you'll find something.

 
Average of ratings: -
Picture of Dhammika Dolawattha
Re: "compileSdkVersion is not specified" when running cordova run android
 

Dear Mr. Dani,

Again, I did all the activities mentioned under the troubleshooting on the same page (Setting up your development environment for Moodle Mobile 2). And also remove and add android platform. Add Android support repository, google play and android support library. Finally 'Cordova run Android' is ok. Apk file was generated. But the problem is when that apk file is installed in a real device, only showing it's Moodle splash. It won't show login or other pages of the app. What is the reason for that?

thanks

Dhammika

 
Average of ratings: -
Picture of Dani Palou
Re: "compileSdkVersion is not specified" when running cordova run android
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

Please make sure all the Cordova plugins are installed. You can use this tool to open the Console and see if there's any error in there.

 
Average of ratings: -
Picture of Dhammika Dolawattha
Re: "compileSdkVersion is not specified" when running cordova run android
 

Hi,

when use "cordova run android" following lines are displaying. But when installing apk file on a real device it is only showing splash. Which cordova plugin should install and how they install?.


C:\Users\Admin>cd c:\moodlemobiledirectory


c:\moodlemobiledirectory>cordova run android

Android Studio project detected

ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_181

studio

Subproject Path: CordovaLib

Subproject Path: app

publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

        at build_1pfka4hu16y6wfhslc8rbjyuj.run(C:\moodlemobiledirectory\platforms\android\app\build.gradle:144)

:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE

:CordovaLib:compileDebugAidl UP-TO-DATE

:CordovaLib:compileDebugRenderscript UP-TO-DATE

:CordovaLib:checkDebugManifest UP-TO-DATE

:CordovaLib:generateDebugBuildConfig UP-TO-DATE

:CordovaLib:prepareLintJar UP-TO-DATE

:CordovaLib:generateDebugResValues UP-TO-DATE

:CordovaLib:generateDebugResources UP-TO-DATE

:CordovaLib:packageDebugResources UP-TO-DATE

:CordovaLib:platformAttrExtractor UP-TO-DATE

:CordovaLib:processDebugManifest UP-TO-DATE

:CordovaLib:processDebugResources UP-TO-DATE

:CordovaLib:generateDebugSources UP-TO-DATE

:CordovaLib:javaPreCompileDebug UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE

:CordovaLib:processDebugJavaRes NO-SOURCE

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE

:app:preBuild UP-TO-DATE

:app:preDebugBuild UP-TO-DATE

:app:compileDebugAidl UP-TO-DATE

:CordovaLib:packageDebugRenderscript NO-SOURCE

:app:compileDebugRenderscript UP-TO-DATE

:app:checkDebugManifest UP-TO-DATE

:app:generateDebugBuildConfig UP-TO-DATE

:app:prepareLintJar UP-TO-DATE

:app:generateDebugResValues UP-TO-DATE

:app:generateDebugResources UP-TO-DATE

:app:mergeDebugResources UP-TO-DATE

:app:createDebugCompatibleScreenManifests UP-TO-DATE

:app:processDebugManifest UP-TO-DATE

:app:splitsDiscoveryTaskDebug UP-TO-DATE

:app:processDebugResources UP-TO-DATE

:app:generateDebugSources UP-TO-DATE

:app:javaPreCompileDebug UP-TO-DATE

:app:compileDebugJavaWithJavac UP-TO-DATE

:app:compileDebugNdk NO-SOURCE

:app:compileDebugSources UP-TO-DATE

:CordovaLib:mergeDebugShaders UP-TO-DATE

:CordovaLib:compileDebugShaders UP-TO-DATE

:CordovaLib:generateDebugAssets UP-TO-DATE

:CordovaLib:mergeDebugAssets UP-TO-DATE

:app:mergeDebugShaders UP-TO-DATE

:app:compileDebugShaders UP-TO-DATE

:app:generateDebugAssets UP-TO-DATE

:app:mergeDebugAssets UP-TO-DATE

:app:transformClassesWithStackFramesFixerForDebug UP-TO-DATE

:app:transformClassesWithDesugarForDebug UP-TO-DATE

:app:transformClassesWithDexBuilderForDebug UP-TO-DATE

:app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE

:app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE

:CordovaLib:compileDebugNdk NO-SOURCE

:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE

:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE

:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE

:app:mergeDebugJniLibFolders UP-TO-DATE

:app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE

:app:processDebugJavaRes NO-SOURCE

:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE

:app:validateSigningDebug

:app:packageDebug UP-TO-DATE

:app:assembleDebug UP-TO-DATE

:app:cdvBuildDebug UP-TO-DATE


BUILD SUCCESSFUL in 25s

46 actionable tasks: 1 executed, 45 up-to-date

Built the following apk(s):

        c:\moodlemobiledirectory\platforms\android\app\build\outputs\apk\debug\app-debug.apk

ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_181

No target specified and no devices found, deploying to emulator

No emulator specified, defaulting to Nexus_5X_Edited_API_26

Waiting for emulator to start...

(node:11660) UnhandledPromiseRejectionWarning: CordovaError: Failed to execute shell command "getprop,dev.bootcomplete"" on device: Error: C:\Users\Admin\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 1 Error output:

error: device still connecting

    at c:\moodlemobiledirectory\platforms\android\cordova\lib\Adb.js:88:25

    at _rejected (c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:864:24)

    at c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:890:30

    at Promise.when (c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:1142:31)

    at Promise.promise.promiseDispatch (c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:808:41)

    at c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:624:44

    at runSingle (c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:137:13)

    at flush (c:\moodlemobiledirectory\platforms\android\cordova\node_modules\q\q.js:125:13)

    at process._tickCallback (internal/process/next_tick.js:61:11)

(node:11660) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:11660) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


 
Average of ratings: -
Picture of Dani Palou
Re: "compileSdkVersion is not specified" when running cordova run android
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

the plugins are listed in here:

https://github.com/moodlehq/moodlemobile2/blob/v3.5.0/config.xml#L94

They should be automatically installed when running "npm run setup" as it's explained in the documentation.

Cheers,

Dani

 
Average of ratings: -