Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin doesn't get installed properly with the current ionic app installation #61

Open
ahmedsamyabdelhay opened this issue May 24, 2018 · 2 comments

Comments

@ahmedsamyabdelhay
Copy link

ahmedsamyabdelhay commented May 24, 2018

These are the steps I followed:

  1. Created new app and integrated cordova
  2. Tested out Android and iOS using:
ionic cordova build ios
ionic cordova emulate ios
ionic cordova build android
ionic cordova run android (with my device connected)

All worked fine.

3- I installed Braintree plugin (dpa99c fork because of issue #52
4- Installed Braintree module : npm install --save @ionic-native/braintree
5- Rebuild iOS
6- Got the following error:
Failed to install 'cordova-plugin-braintree': Error: Cannot find module 'xcode' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (/Users/MacBookPro/desktop/projects/LaPWA/plugins/cordova-plugin-braintree/scripts/add_embedded_ios_frameworks.js:3:15) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

7- I shouldn't have done that but I navigated to the plugin directory and installed xcode module for manually.
8- Rebuild iOS and now build is successful !!.
9- I used this code in my app to test things out:
`import { Braintree, PaymentUIOptions, PaymentUIResult } from '@ionic-native/braintree';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  paymentOptions: PaymentUIOptions;

  constructor(public navCtrl: NavController, public alertCtrl: AlertController, public braintree: Braintree) {
    this.paymentOptions = {
     amount: "20",
     primaryDescription: 'You currently paying for purchased items ',
    };

    this.braintree.initialize(TOKEN)
     .then(() => this.braintree.presentDropInPaymentUI(this.paymentOptions))
    .then((result: PaymentUIResult) => {
       console.log(result.nonce)
    })
     .catch((error) => {
       console.log(error)
     });
   }`

10- I got the an error saying : "plugin_not_installed" however the plugin is present under platform/ios/myapp/plugins
11- now for Android ... I did a rebuild
12- I got the following error:

Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. java.lang.IllegalStateException: compileSdkVersion is not specified.

@gillestasse
Copy link

I have the same error when compiling for Android on a clean android project.

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (/home/gilles/.nvm/versions/node/v9.11.1/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/gilles/Android/Sdk)
   NodeJS            : v9.11.1 (/home/gilles/.nvm/versions/node/v9.11.1/bin/node)
   npm               : 5.6.0
   OS                : Linux 4.15

Stacktrace

cordova]  BUILD FAILED in 0s
[cordova]  (node:27773) UnhandledPromiseRejectionWarning: Error: /home/gilles/Documents/coding/rusticity/WORLDFENGUR/paymentFengur/paymentApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
[cordova]  Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
[cordova]  java.lang.IllegalStateException: compileSdkVersion is not specified.
[cordova]  	at com.google.common.base.Preconditions.checkState(Preconditions.java:456)
[cordova]  	at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:590)
[cordova]  	at com.android.build.gradle.BasePlugin.lambda$null$3(BasePlugin.java:555)
[cordova]  	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
[cordova]  	at com.android.build.gradle.BasePlugin.lambda$createTasks$4(BasePlugin.java:551)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
[cordova]  	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
[cordova]  	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
[cordova]  	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
[cordova]  	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
[cordova]  	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
[cordova]  	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
[cordova]  	at com.sun.proxy.$Proxy24.afterEvaluate(Unknown Source)
[cordova]  	at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:75)
[cordova]  	at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:69)
[cordova]  	at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)
[cordova]  	at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
[cordova]  	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
[cordova]  	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:651)
[cordova]  	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:133)
[cordova]  	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
[cordova]  	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
[cordova]  	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
[cordova]  	at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:246)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
[cordova]  	at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:165)
[cordova]  	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:124)
[cordova]  	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:107)
[cordova]  	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
[cordova]  	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
[cordova]  	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
[cordova]  	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
[cordova]  	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
[cordova]  	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
[cordova]  	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[cordova]  	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
[cordova]  	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
[cordova]  	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
[cordova]  	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
[cordova]  	at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
[cordova]  	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:45)
[cordova]  	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
[cordova]  	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
[cordova]  	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
[cordova]  	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:71)
[cordova]  	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
[cordova]  	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
[cordova]  	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
[cordova]  	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
[cordova]  	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
[cordova]  	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
[cordova]  	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
[cordova]  	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
[cordova]  	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
[cordova]  	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
[cordova]  	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
[cordova]  	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:58)
[cordova]  	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:33)
[cordova]  	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
[cordova]  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
[cordova]  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
[cordova]  	at org.gradle.util.Swapper.swap(Swapper.java:38)
[cordova]  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
[cordova]  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
[cordova]  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
[cordova]  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
[cordova]  	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
[cordova]  	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
[cordova]  	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
[cordova]  	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
[cordova]  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[cordova]  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[cordova]  	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
[cordova]  	at java.lang.Thread.run(Thread.java:748)
[cordova]  
[cordova]  FAILURE: Build failed with an exception.

@stefandriy
Copy link

It seems to be caused by #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants