Where is build.xml in android - android

I m making an app which shares its file from assets folder and I m sharing an xml file to other app it gives me this exception
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
I got this TUTORIAL but at point number 7 it says that "ADD THIS SECTION TO THE END OF build.xml" so where can I get this build.xml??
And any way around to resolve this exception??
I m using MAC OS X

Run android update project -p ..., where the ... is the path to the project. This will create or update the build.xml and related command-line build files. This assumes that your SDK's tools/ directory in your PATH; otherwise, you will need to fully-qualify the path to the android command.I hope it will helps you .

Follow this Procedure To Use build.xml
Go to your Android SDK installation, and open the file "tools/ant/build.xml", copy the complete "test" target and paste it in the "build.xml" of the test project, before the import of build.xml, so before the comment starting with "Import the actual build file". There is more information on how to customize targets in that comment.
If its Confusing Follow this for Complete Ant....
Hope You understand..

Related

Decomposed source code from apk file, but it won't open in Android Studio

So my harddrive recently got wiped and I lost my source code for one of my projects, now I found a way to decompose the source code from the apk file but I can't get it to open in Android Studio. I am trying to upload this source code to GitHub but when I try to share it from Android Studio I get the error message "Cannot run program "git.exe": CreateProcess error =2, The system could not find the specified file".
Any help is appreciated!
Right click on the project root folder in project structure and Git->Add (Ctrl+ALt+A) then commit and push all our files will be in the repo..

Installing Android Studio issue with .gradle file

I just install android studio on a VM machine (VM Fusion). When I try to create a new project, I get the message "org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'."
I followed the suggestion found in the page.
Download Gradle directly from
http://services.gradle.org/distributions/gradle-1.6-bin.zip
Copy the contents of gradle-1.6 to
\Android\android-studio\plugins\gradle
Copy gradle.jar to \Android\android-studio\lib\
Restart Android Studio
It did not work. I get the error message
I tried to copy the zip package /gradle-1.6-bin.zip to the following location
C:\Documents and Settings\myusername.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\
the .gradle file was not there. I look in setting and notice that it under \vmware-host\sharefolders. I went there and the file was still not there. I unhide hidden file and folder with no luck.
In addition, when I create a new project, I notice the project location is \vmware-host\Shared Folders\AndroidStudioProjects\MyApplicationProject.
How can I get a new .gradle file or tell android studio to look at a different folder? How do I change the project location so it does not default to \vmware-host but instead to c:\development.
Any kind of help would be greatly appreciated.
Thanks,
JF
Copying Gradle inside Studio will not help. Just install it somewhere else and after manually creating a project you can import it in Studio and select which installation of Gradle to use.
You have to create the project manually, because right now creating a project from studio always use the wrapper that automatically download gradle from the online repository.
We are working on having an offline mode for project creation, but it's not available yet.
Just edit your System's DNS settings, and redirect services.gradle.com to 127.0.0.1 then use a small web server and serve the file under its appropriate directory (distributions)
As you said,"Copy the contents of gradle-1.6 to \Android\android-studio\plugins\gradle",this folder under the setup path.
Why did you copy it to "Documents and Settings"?

How to run Android project from folder with gen and auto-gen files

It is kind of easy Q, but I am stick, I have the file ready with all files like java xml files every things, and I have Eclipse ready too, but HOW TO RUN
thx
Open your existing project through the following path:
File->New->Other->Android Project from Existing Code
Then click on the run button to run your code.
To generating an APK you need to follow this path:
File->Export->Android->Export Android Application
Enjoy :-)

Cocos2dx Android: Get data from file(assets/*) failed

Where do you need to add your images in your Cocos2dx Android project (in Eclipse)?
They're currently in the 'Resources' folder like what is mentioned on Ray Wenderlich's blog, but I get an error when I run it in the emulator: "get data from (assets/myFileName) failed" for each image. I also added these images to the assets folder in Eclipse, and it makes no difference.
It works fine on the iOS side.
Any suggestions?
I believe you need to run ./build_native.sh in your android folder before run on Eclipse.
So the actual problem wasn't with the building or copying process.
I had a class I made that would apply the correct prefix to a CCSprite if it was an iphone, ipad, etc. And I made some changes to the CCMenuItemImage source code to incorporate this file, but the iOS and Android Cocos2dx files are separate, so the Android project wasn't using the new code, and wasn't adding the correct prefix, so it wasn't finding the image.
Thank you everyone for your answers!
You no need to add to the assets folder , when you run ./build_native.sh it will automatically add to the assets folder. Check it build successfully without any errors and then import to eclipse.
Try using
const char *path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("testimage.png");
before giving cocos2d-x your filename.
This was the same problem I face. Actually I have solved this problem by doing:
Run the ./build_native.sh from cygwin. This step to move the asset needed to android project. Dont forget to chmod 777 -R first to your cocos project, i've got an error because the build_native.sh doesn't have permission to move the assets.
In eclipse, build it again following this tutorial. In that link, it shows how to build the cpp source + cocos2d in eclipse.
Run as android application, then the .apk will be generated.
I'm using the Cocos2d-JS version.
If you have an empty JS file that is imported in your project.json, you will get this very error on Android.
In this case, solution is to not have any empty JS files imported.

New android SDK 17 issue in my app?

Today i was update my android sdk to new android adk-17 .
i am facing some problems in this, that is unable to show AddMob in my app, if i remove addmob in the code able to run the app without any errors otherwise not. what is the solution for this, is this bug in new sdk.
this is the Logcat information
Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader
dalvik.system.PathClassLoader[/data/app/com.veritra.iflipout-1.apk]
Maybe the ADK update has messed-up with your project's build-path.
Try removing the admob JAR and add it again to your libs folder, add it to your Build Path and do a Clean Project.
Anyway it's hard to help you without more details on the error you encounter.
EDIT following poster's comment about not having a libs folder:
You should try this:
Remove all references to the AdMob JAR in your project -> your code should not build without error anymore
Create à libs folder at the root of your project
Copy the AdMob JAR into the libs folder
Make sure this AdMob JAR is in your Build Path (this will allow your code to build wihtout error)
(If still not running OK) Right click your project > Android Tools > Fix Project Properties
The 'problem' here is that the SDK is a lot more strict about the libraries. If you do not check the library as 'exported' in eclipse, it is not added to your APK, leading to this nasty class not found exception. You should mark your libraries as exported.
Project Properties | Java Build Path | Order and Export
when I updated my SDK it was total mess. Well, the only I had to change was the PATH in Environment Variables.
http://developer.android.com/sdk/installing.html :
Adding both tools/ and platform-tools/ to your PATH lets you run command line tools without needing to supply the full path to the tool directories. Depending on your operating system, you can include these directories in your PATH in the following way:
On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ and platform-tools/ directories to the path.
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ and platform-tools/ directories to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:/tools:/platform-tools
On a Mac OS X, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you don't already have one.

Categories

Resources