Closed newnewcoder closed 7 years ago
I think I know what went wrong.
Maybe missing a file package.json
.
I add a package.json
to folder app
like below:
{
"main": "main.js",
"name": "tic-tac-toe",
"version": "3.0.0"
}
Thanks for this. I am going to check on this coming weekend.
I can simultaneously update the project to ns 3 from ns 2 which can solve some compatibility issues.
I have upgraded the project to NativeScript 3.x and I would appreciate if @newnewcoder can try if it works for you now.
I pull this project, and try tns run android
then I get the exception below:
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
/Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/platforms/android/src/main/java/com/tns/gen/android/content/BroadcastReceiver_frnal_ts_helpers_l58_c38__BroadcastReceiver.java
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:60)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
:asbg:generateBindings FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/platforms/android/build-tools/android-static-binding-generator/build.gradle' line: 251
* What went wrong:
Execution failed for task ':asbg:generateBindings'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/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.
BUILD FAILED
Total time: 11.05 secs
Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/hooks/after-watch/nativescript-dev-typescript.js
And I try tns run ios
Does not work either:
Searching for devices...
Executing before-liveSync hook from /Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from /Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Preparing project...
Project successfully prepared (iOS)
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.DiaLog on device F7AC41B2-D74E-4B5E-AE58-5DCCDB621155.
Executing before-watch hook from /Users/Pinky/Documents/nativescriptWorkspace/tic-tac-toe/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
objc[69460]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11c364998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11c189d38). One of the two will be used. Which one is undefined.
1 0x107dd733c -[TNSRuntime executeModule:referredBy:]
2 0x10797c489 main
3 0x10bd9068d start
undefined:7:68: JS ERROR TypeError: undefined is not an object (evaluating 'b.prototype')
Sep 5 21:18:06 PinkydeMacBook-Air com.apple.CoreSimulator.SimDevice.F7AC41B2-D74E-4B5E-AE58-5DCCDB621155.launchd_sim[69103] (UIKitApplication:org.nativescript.DiaLog[0xad10][69460]): Service exited due to Segmentation fault: 11
9:18:07 PM - Compilation complete. Watching for file changes.
Do you get same message with "tns build android" / "tns build ios" @newnewcoder ? And do you get any warnings with "tns doctor" ?
Yes, I get the same message with tns build android
and tns build ios
.
And get no warning with tns doctor
.
what do you get if you run "tns info"? And does newly created apps work on you machine ( "tns create testapp --ng" & "run tns run ios/android" )?
Thanks for your suggestion.
When I tried tns info & tns create testapp --ng & run tns run ios/android
, I found tns has insufficient permission, which causes the error.
I reinstalled node using nvm instead of using brew, and reinstalled nativescript again. problem solved.
Thanks again!!
I'm glad that it solved for you, and thanks for reporting back. :star2:
I clone this project and run command below:
it is built success but crash when running.
I get exception message below:
How can I fix this?
My node version is
v8.4.0
, tns version is3.1.3