PeterStaev / nativescript-purchase

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

Can not compile on Windows machine #95

Closed vahidvdn closed 4 years ago

vahidvdn commented 4 years ago

When I want to run:

grunt compile

I get the following errors:

Running "compile" task

Running "clean:build" (clean) task
>> 0 paths cleaned.

Running "exec:tsCompile" (exec) task
>> '.' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:tsCompile" failed. Use --force to continue.

Aborted due to warnings.

Normally I can solve this error in Windows, but here you use grunt for the build process and I don't know what to do with grunt to make it work. Any idea?

PeterStaev commented 4 years ago

Hey @vahidvdn , sadly not sure what the problem is. All of my plugins have been on Mac so probably something related to the difference in path style. But since I never tried to build under windows I can't be 100% sure.

vahidvdn commented 4 years ago

Hey @PeterStaev I found them in gruntfile.js and changed the following:

cmd: "./node_modules/.bin/tsc --project tsconfig.json --outDir " + localConfig.outDir
cmd: "./node_modules/.bin/tslint --project tsconfig.json --type-check"

To:

cmd: '"node_modules/.bin/tsc" --project tsconfig.json --outDir ' + localConfig.outDir
cmd: '"node_modules/.bin/tslint" --project tsconfig.json --type-check'

According to what mentioned here

Also I changed this:

cmd: "./gradlew build",

To:

cmd: 'gradlew build',

Now I get the following error:

BUILD FAILED

Total time: 6 mins 47.467 secs
>> FAILURE: Build failed with an exception.
>>
>> * What went wrong:
>> A problem occurred configuring project ':inappbillinghelper'.
>> > failed to find target with hash string 'android-22' in: C:\Android\android-sdk
>>
>> * Try:
>> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:build_android_aar" failed. Use --force to continue.

Aborted due to warnings.

Any idea?

PeterStaev commented 4 years ago

Well the last error tells you what is wrong - it needs android-22 SDK installed.

vahidvdn commented 4 years ago

@PeterStaev I've installed the other versions of android SDK. Is there any chance to let it compile with my own version of SDK?

PeterStaev commented 4 years ago

@vahidvdn you should update the native android project located in the android folder to the SDK you want.

vahidvdn commented 4 years ago

Thanks @PeterStaev I was able to change it to version 28 and make it work. And one more question. Is this library implemented Google's in-app billing version 3 method?

PeterStaev commented 4 years ago

Yes, this uses the v3 AIDLs