cocos2d create_project.py not working - cocos2d-x

I am trying to create a new project on cocos2d in Win 8, but when I execute the create_proyect.py on the command prompt it seems to be skiping the parameters.
create_project.py -project randomName -package com.MyCompany.AwsomeGame -language cpp
The above command's result is the same as:
create_project.py

I was facing the same issue and Finally I solved the problem by using this command
$ python create_project.py -project MyGame -package com.MyCompany.AwesomeGame -language cpp

Related

Run gulp via cake Start-Process

I'm building site via gulp inside a windows container:
mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-1909
The container have nodejs and gulp-cli installed in it as following (in Dockerfile):
#Install NodeJs
RUN (New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/v12.16.3/node-v12.16.3-win-x64.zip', 'node.zip'); \
Expand-Archive -LiteralPath 'node.zip' -DestinationPath '.' ; \
Start-Process -FilePath '.\node-v12.16.3-win-x64\npm' -NoNewWindow -Wait -ArgumentList 'install -g gulp-cli' ; \
$env:PATH = 'c:\tools\node-v12.16.3-win-x64;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
As you can see I'm installing node in the container under c:\tools\node-v12.16.3-win-x64.
In my cake script i try to execute gulp file as following:
StartProcess("cmd", new ProcessSettings {
Arguments = "/c gulp",
WorkingDirectory = projectDir)
});
But seems that Start-Process cannot find the file... I'm getting this output from cake Start-Process:
Executing: "cmd" /c gulp
'gulp' is not recognized as an internal or external command
Running the container interactive I can see the file it is in that place and if I run gulp from projectDir all works.
I've also try it to run it like all of the following forms without success:
StartProcess("powershell", new ProcessSettings {
Arguments = "gulp",
WorkingDirectory = projectDir)
});
StartProcess("gulp");
StartProcess("gulp.cmd");
This is the output from within the container regarding npn, gulp versions (requested from comments):
EDIT:
That 'Local version: Unknown' seems off. Is C:\code your project directory?
When I look at the 'official' gulp configuration steps, the installation results in having both a CLI and local version.
(see: https://gulpjs.com/docs/en/getting-started/quick-start/ )
You could consider using Cake.Gulp which can help run gulp with cake either from a local or global installation:
Namespace: https://cakebuild.net/api/Cake.Gulp/
Example usage: https://cake-contrib.github.io/Cake.Gulp/docs/usage/examples
Perhaps making sure that npm installed gulp locally might do the trick because cake is expecting a local variant. I am unfortunately inexperienced with cake, so this is my best guess after doing some basic research.
(one of my sources: Why do we need to install gulp globally and locally? )
Original answer
You could try using an absolute path to the gulp application.
For example:
StartProcess("cmd", new ProcessSettings {
Arguments = "/c c:\tools\node-v12.16.3-win-x64\gulp",
WorkingDirectory = projectDir)
});
It could be that your environment is not set properly, I found this that could be of use: Appending to PATH in a Windows Docker container

duplicate symbol _RCTRemoteNotificationReceived

I am not able to resolve this issue from so long please do help me anyone..
Apple Mach-O Linker (Id) Error
Linker command failed with exit code 1 (use -v to see invocation)
Ld /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify- bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/newNotify.app/newNotify normal arm64
cd /Users/anubhavpilania/newNotify/ios
export IPHONEOS_DEPLOYMENT_TARGET=11.4
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -
L/Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos -F/Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef
/Build/Products/Debug-iphoneos -filelist /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Intermediates.noindex/newNotify.build/Debug-iphoneos/newNotify.build/Objects-normal/arm64/newNotify.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=11.4 -Xlinker -object_path_lto -Xlinker /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Intermediates.noindex/newNotify.build/Debug-iphoneos/newNotify.build/Objects-normal/arm64/newNotify_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -lc++ -ObjC /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTPushNotification.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTBlob.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTAzureNotificationHubManager.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libWindowsAzureMessaging.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTAnimation.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libReact.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTActionSheet.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTGeolocation.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTImage.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTLinking.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTNetwork.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTSettings.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTText.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTVibration.a /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTWebSocket.a -Xlinker -dependency_info -Xlinker /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Intermediates.noindex/newNotify.build/Debug-iphoneos/newNotify.build/Objects-normal/arm64/newNotify_dependency_info.dat -o /Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/newNotify.app/newNotify
duplicate symbol _RCTRemoteNotificationReceived in:
/Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTPushNotification.a(RCTPushNotificationManager.o)
/Users/anubhavpilania/Library/Developer/Xcode/DerivedData/newNotify-bcawjuyeqhqkypfnultgtirfnbef/Build/Products/Debug-iphoneos/libRCTAzureNotificationHubManager.a(RCTAzureNotificationHubManager.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my case this issue occurred when I switched from PushNotificationIOS provided with the React Native core to the extracted version from #react-native-community/push-notification-ios. (Around version RN 0.60)
After linking the new library and installing the CocoaPods dependencies of the iOS project this issue started popping up.
For some reason while setting up the core RN Push Notification library I manually added libRCTPushNotification.a to the "Linked Frameworks and Libraries" of my project. Removing this reference to the core library resolved the issue and let me compile again.
The PushNotificationIOS was split out from the core React Native. So this issue comes up when migrating to the new module #react-native-community/push-notification-ios.
To fix this, just remove or comment out the PushNotificationIOS library from the Podfile: ./ios/Podfile
pod 'React-RCTPushNotification', :path => '../node_modules/react-
native/Libraries/PushNotificationIOS'
Then, run the following commands:
rm -rf Pods
pod install
Rebuild and then run your project.
If you are using a Podfile you can also remove React-RCTPushNotification and add the following...
pod 'RNCPushNotificationIOS', :path => '../node_modules/#react-native-community/push-notification-ios'
because React-RCTPushNotification is from 'react-native' but push notifications has been moved to #react-native-community.
I ran into the same issue as #Padarom, upgrading.
In Podfile, I had to remove the RCTPushNotification line
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
.....
"RCTPushNotification", <== REMOVE
after another pod install it worked

Didn't find class org.cocos2dx.cpp.AppActivity

Cocos2d-x version 3 problems running Android test application.
I've followed the instructions how to create a new project using the cocos.py script.
This works fine. Then I follow the instructions running build_native.py. Import the Android test application to Eclipse. When I try to run it on a device I get.
05-09 10:54:42.363: E/AndroidRuntime(18170): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycompany.testAndroid/org.cocos2dx.cpp.AppActivity}: java.lang.ClassNotFoundException: Didn't find class "org.cocos2dx.cpp.AppActivity" on path: DexPathList[[zip file "/data/app/com.mycompany.testAndroid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.mycompany.testAndroid-1, /vendor/lib, /system/lib]]
Any ideas how to fix this problem?
You application has not org.cocos2dx.cpp.AppActivity class.
Check, that required activity really exists.
For ex. if you proj.android/AndroidManifest.xml contains:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.testAndroid"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
...
<activity android:name=".AppActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|screenSize|smallestScreenSize»>
Then you should have proj.android/src/com/mycompany/testAndroid/AppActivity.java:
package com.mycompany.testAndroid;
import org.cocos2dx.lib.Cocos2dxActivity;
public class AppActivity extends Cocos2dxActivity {
}
Use cocos console. It is quite useful tool.
I will describe example with simple project on linux.
You should have installed ant, python, sdk, ndk, jdk, jre, cocos2dx-3
First - you should create new project. Run in terminal
cocos new TestProject -l cpp -p com.example.test
Open folder with project
cd TestProject
Run project
cocos run -p android
It will run sdk with HelloWorld example

Build ActionScript Native Extension

I'am trying to build an ANE,
this is my extension.xml
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.skunk.nativelibrary</id>
<versionNumber>1</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>boot.jar</nativeLibrary>
<initializer>com.skunk.startonboot.NativeLibraryExtension</initializer>
<finalizer>com.skunk.startonboot.NativeLibraryExtension</finalizer>
</applicationDeployment>
</platform>
</platforms>
</extension>
I call it this way on the Flex Library Project :
context = ExtensionContext.createExtensionContext("com.skunkkk.nativelibrary", null);
I have a folder containing those doc :
Boot.jar ( the native part )
The extension.xml file
The SWC from the Flex Library Project
The SWF extarcted from the last file
The .P12 keyFile
Finally I run this on the cmd :
adt -package -storetype pkcs12 -storepass [keyPassWord] -keystore skunkkk.p12 -tsa none -target ane StartOnBoot.ane extension.xml -swc SkunKNativeLibrary.swc -platform Android-ARM library.swf boot.jar
What could possibly be wrong ? Thank you !
I followed this tutorial just to see, created an ANE with his source code, My application crashes when using it ...
I don't know if I need a compatibility configuration for the ANE, anyway, I am using Adobe Flash Builder 4.6, Flex SDK 4.6.0, AIR 3.1, Eclipse Kepler and testing on Android 4.1.2
I was running a wrong command, this is how it worked :
adt -package -storetype pkcs12 -keystore FILE_KEY_NAME.p12 -storepass FILE_KEY_PASSWORD -target ane LIBRARY_NAME.ane extension.xml -swc SWC_FILE_NAME.swc -platform Android-ARM -C android_lib_dir .
Of course, I have the library.swf and NATIVEPROJECT.jar inside the directory android_lib_dir
May be someone will face the same problem,

ADT Captive Runtime Package Command Line Error

I'm attempting (unsuccessfully) to package a captive runtime of AIR 3.3 application for Windows 7 using the command prompt.
The arguments passed to ADT are correct, as i do not receive errors and i'm prompted for the certificate password:
C:\Users\Geoffrey Mattie>"C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\
adt.bat" -package -keystore "G:\Desktop\AIRCert.p12" -storetype pkcs12 -target b
undle "G:\Desktop\Off Air" "G:\Developer\OffAir\application.xml" -C "G:\Deve
loper\OffAir\bin\OffAir.swf" -C "G:\Developer\OffAir\assets\offAirIcon.png"
password:
However, after entering the password i receive this:
unexpected failure: inputs not set
java.lang.IllegalStateException: inputs not set
at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.j
ava:61)
at com.adobe.air.nai.NativePackager.createPackage(NativePackager.java:96
)
at com.adobe.air.ADT.parseArgsAndGo(ADT.java:564)
at com.adobe.air.ADT.run(ADT.java:418)
at com.adobe.air.ADT.main(ADT.java:468)
C:\Users\Geoffrey Mattie>
Could this be happening because my application files are located on the G drive while ADT and Java are on the C drive? Any ideas?
I think you need to specify the name of your .exe file. Instead of:
-target bundle "G:\Desktop\Off Air"
It should probably be:
-target bundle "G:\Desktop\Off Air\MyApp.exe"
Or:
_target bundle "G:\Desktop\Off Air\MyApp.app"
It appears that there was a problem with my manual merging of the AIR 3.4 and Flex 4.6 SDKs. Using the pre-merged version on Adobe's Gaming website solves the issue.