PeterStaev / nativescript-purchase

:moneybag: A NativeScript plugin for making in-app purchases!
Apache License 2.0
83 stars 28 forks source link

Error while building the app in nativescript angular after installing the plugin #68

Closed an-ravishankar closed 5 years ago

an-ravishankar commented 5 years ago

Hello, I have installed the plugin but the app exits with the following error

Exception in thread "main" java.lang.VerifyError
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
        at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
        at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
        at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583)
        at org.nativescript.staticbindinggenerator.GetInterfaceNames.generateInterfaceFile(GetInterfaceNames.java:39)
        at org.nativescript.staticbindinggenerator.Main.main(Main.java:41)
Caused by: java.lang.VerifyError: Cannot inherit from final class
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.nativescript.staticbindinggenerator.GetInterfaceNames.generateInterfaceNames(GetInterfaceNames.java:68)
        at org.nativescript.staticbindinggenerator.GetInterfaceNames.lambda$generateInterfaceFile$0(GetInterfaceNames.java:35)
        at org.nativescript.staticbindinggenerator.ThrowingConsumer.accept(ThrowingConsumer.java:11)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
        at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1040)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:runSbg'.
> Process 'command '/usr/share/java/jdk1.8.0_171/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 41s
Unable to apply changes on device: ZY222V692N. Error is: Command ./gradlew failed with exit code 1.
Stopping tsc watch
Stopping webpack watch
an-ravishankar commented 5 years ago

Please help

PeterStaev commented 5 years ago

Hey @sportyravi , I do not see anything in the stack trace that points that the problem is with the plugin. Please try to clear your platforms and node_modules and then rebuild.

an-ravishankar commented 5 years ago

okay will try it

an-ravishankar commented 5 years ago

Hello @PeterStaev,I am getting the same error What I am doing is I have installed the plugin and I am trying to build the app I have done nothing in the code side is there any billing key that need to be put while installation I have followed the part-1 link (Adding the plugin to your application and creating a purchase workflow)

PeterStaev commented 5 years ago

There is no billing key. All that needs to be done is outlined in the docs/blog articles. Sadly I have no idea what might be causing this problem. So you are saying that you do not use the plugin anywhere in the code and it again fails with that exception? Try building the demo app attached to this repo and seeif that will build.

an-ravishankar commented 5 years ago

OK will try building that

On Fri 29 Mar, 2019, 5:23 PM Peter Staev, notifications@github.com wrote:

There is no billing key. All that needs to be done is outlined in the docs/blog articles. Sadly I have no idea what might be causing this problem. So you are saying that you do not use the plugin anywhere in the code and it again fails with that exception? Try building the demo app attached to this repo and seeif that will build.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PeterStaev/nativescript-purchase/issues/68#issuecomment-477970886, or mute the thread https://github.com/notifications/unsubscribe-auth/Aut_ITxOYCpxTSLB_6q2PdJrDhxMWBMYks5vbf6mgaJpZM4cNjx- .

marayshi commented 5 years ago

Hi I have the same issue with nativescript-vue getting this error just after installing the nativescript-purchase

erjdriver commented 5 years ago

That's a build issue with the new 5.3 NS release.

Go back to 5.2 and should be ok.

PeterStaev commented 5 years ago

For reference here is the related issues in the android-runtime repo: https://github.com/NativeScript/android-runtime/issues/1329

marayshi commented 5 years ago

thank you @erjdriver its worked after downgrade to 5.2

an-ravishankar commented 5 years ago

Thank you @erjdriver the app is building properly now Thank you everyone for your replies

an-ravishankar commented 5 years ago

Hello everyone Thank you for your support the purchase has been implemented successfully. Closing this issue