Whenever I execute phonegap build android/ios, my asset folder is getting reset to sample folder and source code.
Because of this , whatever the code I am copying into the asset/www it is being overwritten by sample codes of phonegap
Does anybody come across this issue.
What could be the reason.?
This is the correct behavior of cordova/phonegap project.
Under yourProjectRoot/platforms/android/assets/www there are the source copied in build phase from the yourProjectRoot/www directory, you must implement your HTML5/js code in this folder, this is the entry point for you source.
I suggest you to take a look here: Build the App before start the development.
Help of PhoneGap build command says:
Builds your application for one or more specified platforms. When no
platforms are specified, all installed platforms will be built.
The build task will first prepare and then compile your application.
If you want more control, you can individually prepare and compile
your application with the commands.
Your platform specific www folder is overwritten because prepare command is fired.
If you preparing your entire project in platform specific folder like ${PROJECT_ROOT}/platforms/android and you want to compile it than you have to run phonegap compile your_platform. It will bypass prepare and go straight to compile.
Related
How can connect with SQLLite from Android using Unit3D and Javascript?
Someone can'i help me?
Here are the specific steps to getting SQLite set up in your project.
Download SQLite - you'll want the ZIP file with the DLL inside
that's in the Precompiled Binaries for Windows section.
Important Copy sqlite3.dll into your into your project's Plugins folder (make a folder called Plugins if you don't have one).
You won't get a warning if you don't do this, and your project will run fine in the editor, however, it will fail to work when you actually build your project, and will only provide information about this in the log file.
This will give you a License Error if you're using Unity Indie, but it doesn't seem to have an effect on the actual play in the editor, nor does it seem to effect the ability to build stand-alone versions.
Alternately, you can leave it out of your project entirely, but when you build your application, you'll need to include a copy of sqlite3.dll in the same directory as the .exe in order for it to work.
In your project, add in the dbAccess.js file: http://wiki.unity3d.com/index.php/SQLite#dbAccess.js
You should be good to go!
Source (and the above is pretty much copied word-for-word from):
http://wiki.unity3d.com/index.php/SQLite
I'm using crosswalk for an android app as per this guide.
While developing only with cordova (no xwalk), I could ignore certain files and folders on build by using aapt.ignore.assets in the ant.properties config file, to exclude the files that I didn't want packaged - i.e. node_modules. When using crosswalk this file is completely ignored for me.
In the build process the .dotfiles are automatically excluded, but as per npm specifications the node_modules folder cannot be renamed in any way. There are a few files that I wouldn't like to package on every build, especially since the build fails if the node_modules is included, throwing me this error:
/mypath/Sdk/tools/ant/build.xml:932: The following error occurred while executing this line:
/mypath/Sdk/tools/ant/build.xml:950: null returned: 1
...
/mypath/release-multi/cordova/node_modules/q/q.js:126
Currently while I develop I've gotta remove and re-add the folder every time I have to test a build and it's a complete hassle.
Any other while to forcefully exclude a list of files on build? I'm not an android dev -- currently only working with webapps.
I've used create-android-project.sh to successfully create an Android app as part of my Cocos2d-x project. Now I want to move the app's directory and all contents to a different location in my local file system.
When I try to build the app after moving it I receive the error:
'make: *** Android NDK: Aborting. Stop.'
How can move my current project around the local file system and still have it build and run correctly?
If I need to re-create the Android project after modifying the creation scripts that's fine too. I looked through create-android-project.sh and it wasn't obvious to me how I can modify the script to create the project in another directory of my choice. Or perhaps I need to adjust some of the settings in Eclipse.
Changing the COCOS2DX_ROOT in build_native.sh to an absolute path makes the project compile successfully.
This is similar to NDK_ROOT defined at the top of the file.
I am relatively new to Cocos2d-x and I am trying to build a project targeting iOS & Android devices. Building the Cpp project with Xcode (for iOS) is pretty fast but for Android you have to first compile the whole project with NDK which always recompiles the whole cocos2d framework and this takes up to 2 minutes for every single change I'd like to test on a device.
Can I somehow configure my build_native.sh or Android.mk file to use the compiled cocos2d framework and just compile my files in the Classes folder? I am working with version cocos2d-2.1beta3-x-2.1.0
Put this settings in Eclipse-> Project->Properties -> C/C++ Build
Uncheck the Use default build command
Build Command: bash ${workspace_loc:/XYZProjName}/build_native.sh NDK_DEBUG=1 V=1
Makefile generation should be disabled....
Build directory: ${workspace_loc:/XYZProjName}
Now just Build Project it will recompile your projects file only ...Whenever you clean and build it rebuilds the cocos2d-x framwork also
which happens to be same in Xcode as far as my knowledge says ...
Whenever you change something in cocos2d-x classes then you neeed to do that clean (which means you are recompiling libgame.so) again which happens to be in the folder proj.android/obj/local/armeabi/ .... here at the location all your library which you are supposed to be using gets compile ..when you clean these all libraries get recompile ..
Hope you understand the concept ..If not ..Feel free to ask I will try to explain more ..
I've never made a program into an executable before, and I've been looking into how to do this for some time now. When I try to put it into a jar everything works fine but when I try to run it nothing happens.
How do I make my game into an executable so it can be run (on windows, not android)
I feel like I am not Linking it to the libraries or something... Not sure.
Thanks!
Edit:
I should add I get the error
JAR export finished with warnings. See details for additional information.
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt
duplicate entry: com/badlogic/gdx/utils/arial-15.png
duplicate entry: com/badlogic/gdx/utils/arial-15.png
Jar export finished with problems.
See details for additional information.
Your problem is that when you use eclipse export as Executable jar file it does not include the assets (graphical, sounds ...) that you used in your gdx project. What you can do manually is either copy your assets folder right next to the generated jar file or include your assets folder in your jar file with your favorite zip management tool.
Another way would be to use this same eclipse export wizard and check "Save as ANT script" and then edit the generated ant file to include all the files and folders needed by your app.
Hope this helps
This is an old question, but if you are using a new version of LibGDX and Gradle you can use the command line to make an executable.
There are several commands, but these are for packaging:
Desktop
gradlew desktop:dist
Android (unsigned)
gradlew android:assembleRelease
iOS
gradlew ios:createIPA
Web
gradlew html:dist
Read more at https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline
I'm assuming your application is setup as the libgdx wiki page suggests (with a "main project" and separate "desktop" and "android" projects that share the sources from the "main" project).
Since your app is written in Java, it requires a JVM to run on a desktop. You have to decide if you want to package that up, or rely on a JVM already being installed by the user. I believe packaging up the JVM with Java class files is very complicated and raises a host of other issues (and it becomes very platform specific). So, I believe most libgdx-based games get distributed as an executable Jar file, which means the user must already have Java. (It works for Minecraft, so its probably good enough for you, too. :)
Eclipse makes that really easy: File -> Export ... -> Java -> Executable Jar File. There may be additional steps required to include assets like your app's images and sounds into this .jar file. (My game is currently "asset free", so I don't have any experience with this part.)
You might also consider side-stepping the desktop executable, and packaging your game as an applet and running it in a web browser so there is very little "installation" required by the folks you want to show it to. Here's a walkthrough for making an applet from a libgdx-based game. (I haven't actually tried this myself yet, but I do have a libgdx-based game that I'm planning on doing this for.)
If you're using Android Studio, you can create a custom configuration to distribute from within the program.
On the Run dropdown list select edit configurations.
Click the "+". Select Gradle.
On the right half of that screen give your configuration a Name.
Gradle Project: Use the browse button to select your desktop application. This will look something like (project name):desktop
Tasks: type "desktop:dist"
Apply.
Close the configuration editor and select your new configuration from the dropdown. Hit run and it should build your project.
Your new Jar file should be located in (ProjectName)/desktop/build/libs