Gradle not recognizing command "createProject" - android

I'm working with Gradle and i'd like to know why I'm getting an error:
Task createProject not found in the root directory bin.
https://bitbucket.org/javafxports/android/wiki/Building%20and%20deploying%20JavaFX%20Applications
Did everything as said in this tutorial, even the createProject command is there but it's not working for me.
cd is set on gradle/bin folder.

You need to run this command from the android-tools directory, not from gradle/bin.

Related

How to sync gradle in React Native (android)?

I tried ./gradlew build but that didn't work, because it doessnt see the changes made in gradle file. The only thing that works for me is restarting and invalidating cache, but there must be a better way to do it.
Thank you
You should try running ./gradlew clean before building.
change directory to /{your project}/android then run below commands
./gradlew clean
./gradlew build
Note :-
you will get error : ./gradlew: No such file or directory
if you are trying gradlew commands outside android folder.
also check this : Why run 'gradle clean build' instead of 'gradle build'?

Jenkins- How to invoke gradle script tasks in different directory than the project root

Project Structure.
Root/
-------Android Project/
----------------------------ProjectRoot
-------Other Folders
My git repo contains Root. Inside root i have my android project.
Now when integrating Jenkins freestyle pipeline,
for wrapper location i simply pass ${workspace}/Android Project where my wrapper actually lies.
But the problem is when i add my tasks: i.e clean | build | assembleDebug its actually running on the Root folder and not inside "Android Project".
i tried "cd Android Project" before running the script but it does not seems to work
i have resolved the issue by simply removing invoke gradle script and adding a shell command window.
Within shell command i cd navigated to the directory i wanted to run the gradle task.
cd to the root directory, then call:
./gradlw :moduleName:gradleTaskName
replace moduleName and gradleTaskName with your project's real names.

Building wpa_supplicant with 'mm' command

I am new to Android. I have the entire source code of Android for the imx platform. I would like to build the wpa_supplicant folder present under external folder. Everytime I make a change, instead of building the entire source, I would like to build only the wpa_supplicant folder. I have read that using the 'mm' command I can do it. However, i am not sure where to find the 'mm' command. For when I type #mm external/wpa_supplicant_8, I get the following error message displayed:
The program 'mm' can be found in the following packages:
* mountmanager
* multimail
Try: apt-get install
I am not sure if I need to do an apt-get install or the binary is present somewhere I else. Can someone help me with this? Also, how do I compile only a single application present in external folder? Please help.
Run the build/envsetup.sh script from your root folder:
path/to/android# . ./build/envsetup.sh
Then lunch for your device, and you'll be able to mm as necessary.
Go to Android directory and run $:source ./build/envsetup.sh
'android$:lunch` and select the configuration which you are building.
Now go to the directory where project located and execute mm or 'mma' (to build the dependencies also)

Phonegap error android sdk build.xml:950 : null returned: 1

I'm trying to launch phonegap android app in android sdk, but I am receiving an error:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[error] An error occurred while building the android project.Error executing "ant debug -f "/Users/me/Projects/one/platforms/android/build.xml"":
BUILD FAILED
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:932: The following error occurred while executing this line:
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:950: null returned: 1
I followed this guide http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html but it is not working.
What could have caused this?
You are most likely also getting the line
invalid resource directory name:
/YOUR/PROJECT/ROOT/PATH/bin/res/crunch
right before the error codes, so open up terminal and enter the following:
cd YOUR/PROJECT/ROOT/PATH
rm -fR $(find . -type d -name crunch|xargs)
I just had to cd into the platforms/android dir and run ant clean and it fixed this issue for me.
had the same issue. something that can help is to read ant log as recommend here
to do so run ant -logfile //antLogFile.txt release -f ./AppMain/build.xml
or in the folder itself. i.e : platforms\android run ant -logfile ./antLogFile.txt release
My issue was a file with Hebrew characters on its name..
Hi Sorry for the late answer
An alternative to other solutions possibly OS-X Specific but i was having the same issue and none of the solutions for me worked however the mention of assets made me go back and scour over my build logs and i noted this:
[aapt] /Users/rowdoggnz/Development/cordova/surveyapp/platforms/android/assets/www/lib/fa/Icon
[aapt] : error: Invalid filename. Unable to add.
This was the cause of my error which shared the same error code and line references as the original poster.
OS-X seems to generate ghost icon files for some reason which are not visible in finder due to being hidden, i used an app called "Invisiblix" to view my project folder and removed all of the 'Icon' files and my app would build fine.
I'm guessing the iOS build naturally ignores these Icon files however Ant doesn't.
Hope this helps someone.
If you have more than one project and you are using the same assets eg: images, ant will fail to build. You can use ant clean to remove the cache from other projects and avoid this issue as suggested in this post crunch/resource packaging with aapt in ant build uses cache from other projects
Nevertheless, In my case I just have one project with many images, some of them were called with the same name, but with different letter case. Ant's build process is case-insensitive, so those images were duplicated, being error cause.
My particular fix was to rename or eliminate one of the images to allow cordova build my project.
I was having this issue in OSX using Ionic framework. This was my fix:
I ran this on the command line in the project root folder:
find . -name Icon -exec rm {} \;
What the above does descend through the whole project to search for files name Icon. Upon finding them they are deleted.
After this I ran my build process and all was good again.
Make sure you have installed the prerequisites correctly.

Android NDK in ADT and Mac OS (10.8): Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH

The error while building is
/ndk-build
Cannot run program "/ndk-build": Unknown reason
Error: Program "/ndk-build" is not found in PATH
PATH=[/usr/bin:/bin:/usr/sbin:/sbin]
I am trying to build a OpenCV project on Eclipse ADT and have done the following so far to build it.
Normal android projects(not involving c/c++ code) works fine.
1- I have edited the /etc/paths to the following
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/tools
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/platfor
m-tools
PATH=$PATH:/Users/mohitagrawal/android-ndk-r8e
2- I have edited $PATH to following(knowingly or unknowingly)
-bash: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/tools:PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/platfor:m-tools:
PATH=$PATH:/Users/mohitagrawal/android-ndk-r8e:/opt/X11/bin:/usr/local/git/bin:/usr/texbin: No such file or directory
3- Build command in "C/C++ Build" in project properties is set to
${NDK_ROOT}/ndk-build
4- NDK location in Preferences of ADT eclipse is set to
/Users/mohitagrawal/android-ndk-r8e
Please help me. I am stuck from many days and has even tried on different platform.
You need to change the PATH in Eclipse since it is Eclipse that is trying to run the command. Go to Project Properties > C/C++ Build > Environment > PATH
Add the path to your ndk directory in the PATH variable (i.e. add /Users/mohitagrawal/android-ndk-r8e to the PATH variable).
Moreover, it apparently tries to run /ndk-build. Make sure that in Project Properties > C/C++ Build, "Build command" is ndk-build and not /ndk-build
EDIT: you can also try to build your project from the terminal, by navigating to your project and running the command ndk-build.
I've tried all the solutions that I could find on stackoverflow and none of them worked.
In the end I've found this blog.
I'll post the solution here as the link may break in the future:
1. Open up Terminal.
2. Run the following command: sudo nano /etc/paths
3. Enter your password, when prompted.
4. Go to the bottom of the file, and enter the path you wish to add.
5. Hit control-x to quit.
6. Enter "Y" to save the modified buffer.

Categories

Resources