Vuforia Rajawali Android - How to build the gradle in git? - vuforia

I'm new to VuforiaRajawali and I'm trying to build and run the example from the site. The problem is when I'm using the command:
C:/.../RajawaliVuforia/RajawaliVuforia/ ./gradlew clean assembleRelease uploadArchives
, I'm always getting the error task 'clean' not found in root project RajawaliVuforia.
If it's possible, please help!
Thanks!

I Guessed that You are using a windows
so
Try the following after installing Git
1- Create a new folder.
2- Enter the created folder then hold Shift Key+ Right click in an EMPTY AREA.
3- select "Open command window here" from the appearing context menu.
4- type or copy pasting the command "git clone https://github.com/Rajawali/RajawaliVuforia.git"
5- Press enter and wait while the git cloning Rajawali.
6- Right Click to (This PC) for windows 8 or above (Computer or My Computer)windows 7 and select Properties.
7- from the left panel select Advanced system settings.
8- from the popped up window click "Environment Variables..." at the bottom.
9- at the top of the new popped window under User variables for [user name]
click on New... and type in
variable name: "ANDROID_HOME".
variable value: [the full Path to android SDK]
10- go the the created folder you will found a folder with name "RajawaliVuforia"
Open it again you will found 3 folders and one has the same name "RajawaliVuforia" Open it and while press Shift Key Right click on an Empty Area and from the context menu select "Open command window here"
write or paste the command "gradlew clean assembleRelease uploadArchives" Press enter.
11- wait for the command to end Now you Are Done you can open the project using android studio

Related

Android Studio- git Clone: "Unable to create destination directory"

I am trying to clone a github repository from my account in my Android studio, but each time I try to clone it by
VCS -> get from version control -> URL, an error message pops up with message:
"Clone: Unable to create destination directory".
What can I do?
Go to your Android Studio installation directory (usually Program Files/Android/Android Studio).
Go to the bin folder.
Right click studio64.exe (or studio.exe if you're using the 32bit
version) and run it as an administrator.
Now clone should work just fine.
I'm sure there is a better solution out there but right now, this should work.
Check your folder path.
In my case, my directory name had whitespace, so I changed the folder name from namu nikam to namunikam.
After that, github cloned the project.
The project error message was:
Cmd doesn't allow us to run commands with any space in between
Sometimes we use underscores between words, like namu_nikam.

Can Gnome Builder actually produce something else than flatpaks?

I can't seem to find any documentation as to how to configure builds to produce something else than the pre-configured flatpaks. Duplicating build configurations and changing the settings doesn't seem to give me the option to produce anything else than flatpaks. Changing the application runtime to "Host System" produces only flatpaks as well. I can't even find the preliminary binaries that seem to be produced somewhere before they're packaged. What am I doing wrong?
For reference, I am using Builder 3.36. My assumption based on your post is you're looking only for your application binary, and not a way to build some other package like .deb or .rpm.
There are a few ways you can do this.
Method 1: From your Flatpak build's directory
Click the omnibar and click "build", not "Export Bundle". When it's completed, click the "View build console contents" button from the same omnibar drop down where the "Export Bundle" button is.
Look at the last lines of output in the terminal for the "flatpak build" command. Look for the "build-dir" parameter passed to this command.
The path will be something like "~/.cache/gnome-builder/projects/AppName/builds/org.your.App.json-flatpak-org.gnome.Platform-x86_64-3.34-unversioned"
Go into this directory. It will have a subdirectory "src" which has your app.
Method 2: Change build configuration
If you click the "Switch Surface" button in the top left and go to "Build Configurations" you should see two configurations created for you by default (if you created the project through Builder). Builder defaults to your JSON file which builds Flatpaks.
Click the "Default" configuration, then click "Make Active" under "Overview". Then you can build the app as normal (e.g. with the omnibar at the top). Once it says "Build succeeded" the binary has been built.
But where? Look for the path listed in the "Overview" for the "Default" configuration -- under "Install Prefix". This will be something like "/home/user/.cache/gnome-builder/install/AppName/host"
In there is a "bin" directory with your app.
Method 3 (Preferred): Build using ninja
From the Editor surface, press CTRL+SHIFT+ALT+T to open a terminal inside Builder, which defaults to your $BUILDDIR
In the terminal that's open, simply type "ninja". If it says "ninja: no work to do." your app is already built and up to date. You can type "ninja clean" and then "ninja" if you want to do a fresh rebuild.
Inside this directory, (something like "~/.cache/gnome-builder/projects/AppName/builds/default-host-unversioned") there will be a "src" directory which is where the app is built.
Running your app
You may not be able to double click this from a file manager, so open the directory in a terminal and type "./appname" to run the app.
In addition to wappa's answer, for GNOME Builder 43, the file system is ~/.var/app/org.gnome.Builder/cache/gnome-builder/projects/<your-project-name>. The default build directory is builds/<your-application-id>.json-flatpak-org.gnome.Platform-43-x86_64-main under the file system; you can find object files, executable files, Meson and Ninja files including build.ninja, etc. here.
Besides, you can find the output Flatpak files at flatpak/staging/x86_64-main under the file system. To export a Flatpak bundle, you can click the down arrow on the top bar and click "export". The exported Flatpak bundle is at this directory. The executable binary file is under files/bin. You can also find application data, icons, font configurations, etc., under the files directory.
To configure the location, you can still click the down arrow on the top bar and click "Configure Project...". On the "Overview" page, you can view which configuration you are using currently, corresponding to the configuration options on the sidebar: "Default" (~/.var/app/org.gnome.Builder/cache/gnome-builder/install/<your-project-name>/host) and <your-application-id>.json. By default, the latter one is selected, whose installation prefix is /app. If you look at the Build Output, you can observe that the desktop file, source files, GSchema XML, AppData XML, Icons, etc., are installed into /app. The /app is the path in Flatpak's sandbox filesystem rather than the path in the main filesystem of your Linux OS.
If you want to avoid using Flatpak, you can go to the build directory and manually build by Meson and Ninja.

sublime text: manually install package control

I cannot use the simple installation code because a proxy blocks my way out. Unfortunately, I just don't get the instructions on the webpage.
1. Click the Preferences > Browse Packages… menu
2. Browse up a folder and then into the Installed Packages/ folder
3. Download Package Control.sublime-package and copy it into the Installed Packages/ directory
4. Restart Sublime Text
What exactly does 2. mean? I guess I literally don't understand what "Browse up a folder and then into..." means.
I did click on the Browse Packages menu and used the popup explorer window to create a folder in my documents directory called Installed Packages. But what's next? Since I am just in a regular Explorer window, it I don't see how sublime now knows about this folder.
In Sublime Text, click the Preferences > Browse Packages… menu
this opens Windows Explorer in the path %AppData%\Roaming\Sublime Text 3\Packages.
Browse up a folder
go up one folder level, the equivalent of cd .. in the command prompt. So basically, you want to be in %AppData%\Roaming\Sublime Text 3.
You can do this using the breadcrumbs in the address bar - using the above image as a guide, click on Sublime Text 3. Alternatively, press Backspace to go up a folder level. (Normally it will go back one history level, but in this case there is no history because it is a new Explorer window, so it will go up a directory in the folder hierarchy.)
and then into the Installed Packages folder
Double click on the Installed Packages folder to navigate into it.
Download Package Control.sublime-package and copy it into the Installed Packages directory
So you will have a file called Package Control.sublime-package in the %AppData%\Roaming\Sublime Text 3\Installed Packages folder.
Restart Sublime Text
Close ST and launch it again.
For Mac users, for No. 2, you'll most likely see this. That is the Packages file
To be able to browse up a folder and view the Installed Packages:
Then from there, download using the link and put it in the installed package folder, there you go!

How to import a Project into bitbucket repository from Android Studio?

So basically I have an Android Studio project on my local computer and I need to add it into my BitBucket repository I created online. I just can't get it right with Android Studio. I can't upload files from Android Studio project to my BitBucket repository.
How can I do such a thing?
Here is how I did it without plugins:
Create the repository on your Bitbucket account
Create your project in Android Studio
In Android Studio, Go to VCS
Choose 'Enable version control'
Choose Git and press OK
Right click on your project, choose Git then click Add
Open Terminal in Android Studio
Go to your Bitbucket repository Overview
Click on 'I have an existing Project'
Copy the 'git remote add origin ... etc.' line to your terminal and press enter
Click on 'Commit Changes', write your comment then press Commit and push
Also add the 'git push -u origin master' in the terminal at part 10 of above
In the Android studio, go to VCS-> 'Enable version control'.
From dropdown menu select Git, then click OK.
Right click on your Project view in the Android Studio:
go to Git -> Add.
(All the files in the project should change the color, turned green probably)
Open Terminal in the Android studio.
From your empty repo in the Bitbucket page, copy from the paragraph "Step 2: Connect your existing repository to Bitbucket" the line :
git remote add origin https://<user>#bitbucket.org/<path>.git, then Enter.
Now type:
git commit -m "initial commit" (to commit all the files from the Project), then Enter.
Now type:
git push -u origin master (to push all the commited files to the master- or the other branch, just change "master" to other branch).
That's it. Your project is versioned and placed in your Bitbucket repo.
Heres is what i did without plugins
Already have a project in Android Studio
1- Create the repository on your Bitbucket account
2- In Android Studio, Go to VCS
3- Choose 'Enable version control'
4- Choose Git and press OK
5- Right click on your project, choose Git then click Add
6- Go to VCS -> Commit Changes
7- Uncheck 'Perform Code Analysis'
8- Press Commit and Push in the Commit button
9- A new window will open, on the left press the DEFINE REMOTE link
10- Go to your Bitbucket repository Overview
11- Click on 'I have an existing Project'
12- Copy the link from bitbucket to the URL tab in the Define Remote Window ,e.g. 'git#bitbucket.org:username/project.git' without the 'git remote add origin...' (maybe it will ask you for a password of your bitbucket account), press Ok
13 Press Push, and it's done
If you want to use Android studio without the use of console/terminal. Use below steps to create a new project in Bitbucket.
Go to VCS in Android Studio
Choose 'Enable version control'
Choose Git and press OK
Right click on your project, choose Git then click Add
Create the repository on your Bitbucket account
Go to your repository in Bitbucket, Copy the https url
Go to Android studio project -> Git -> Repository -> Remotes
Add a new entry with value of https link received from step 6
Android studio -> your project -> Git -> Commit Directory -> Commit & Push
Make sure you define your .ignore file to avoid unnecessary items being copied to bitbucket
From Android Studio, go the the VCS menu on the menu bar and select Import into Version Control, select which VCS you want to use ie: Create GIT repository.
Easiest way is to clone your empty repo with standard "git clone git#bitbucket.org:projectNameAndLocation.git". So let's clone it to the location, as example, user/newAndroidProject.
Create an emtpy Android project from Android studio (let's call it just AProject), in case you don't have one.
Now copy all the files from your new Android project root directory(everything from AProject folder) or just copy all the files from your existing project root directory into the location where your empty repo directory is (into the newAndroidProject folder as example).
So everything from AProject>, goes in the newAndroidProject>.
All the files will be automatically added under the git, inside this repo folder. You can open then for example in the SourceTree your "newAndroidProject" and you will see all the files there and then just push everything to the origin (after you edit your .gitignore file of course).
The BitBucket plugin didn't work with me. However I was able to clone the repository by coping the https url and pasting it in Android Studio then enter the username and password and it should be able to clone it.

How to run NDK samples?

Sorry to ask such a noob question, but the NDK documentation is wrong (r7b):
If you are developing in Eclipse with ADT, use the New Project Wizard
to create a new Android project for each sample, using the "Import
from Existing Source" option and importing the source from
<ndk>/apps/<app_name>/project/. Then, set up an AVD, if necessary, and
build/run the application in the emulator.
There is no "apps" folder, and the samples do not contain a "project" folder. So ... what is the correct way to run a sample?
Also, can I configure Eclipse to build the C++ portion of the code automatically?
Click File | New | Project...
Choose Android project, Next
Project Name: This is the project name shown in Package Explorer. It is just a string stored in the .project file that Eclipse creates. No file or folder is created with this name, and the output binaries do not seem to contain this name.
Click "Create project from existing source"
Location: choose the project's root folder, e.g. .../android-ndk-r7b/samples/bitmap-plasma
Click Next and choose your target API. Eclipse does not seem to allow this to be changed later, at least not from the GUI. I don't know why Eclipse does not simply get this information from <uses-sdk> in AndroidManifest.xml or from the "target" line in default.properties. I also don't know why the two may be different (e.g. in the bitmap-plasma sample, target=android-9 but <uses-sdk android:minSdkVersion="8"/>.)
Click next and consider changing the "Package Name" field which defaults to "your.package.namespace". However, the project will run fine if you do not change this field. Leave "Create Activity" and "Create a Test Project" unchecked.
Click Finish. Eclipse will create numerous extra files (e.g. .classpath, .project, project.properties) and folders (bin, gen, assets) alongside the existing code. That's in addition to the output folders created by ndk-build (obj and libs).
Eclipse won't build the native code by itself, but it will automatically deploy the native code (e.g. libplasma.so) if it is aware of it. After you build the native code on the command line, e.g.:
C:\...\android-ndk-r7b\samples\bitmap-plasma>..\..\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi/libplasma.so
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi-v7a/libplasma.so
Right-click your project and choose "Refresh", otherwise Eclipse might fail to upload the native code when it starts the emulator.
Finally, to run the sample, right-click the project and choose Run As | Android application. See here about choosing which emulator is used.
See here about configuring Eclipse to build the native code automatically.
I am curious why NDK produces two *.so files with very different sizes for each ABI, e.g. it creates libs/armeabi-v7a/libplasma.so (15 KB) but also obj/local/armeabi-v7a/libplasma.so (63 KB). Anyone know the difference?
Instead of going the long winded way ( seasoned programmer love it - but for beginners). There is a way to build the native library in Eclipse and NDK.
1> First you need to make sure NDK path is correct in Windows -> Preference -> (tabs) Android -> NDK - If not set - point it to ndk directory.
2> Assuming you have you imported project as described above (New | Project | Create from existing code) - You right click the project and go to " Android Tools -> Add Native Support ..". If the path is set it will build the example. And then you can deploy it to the device or AVM by pressing the play button.
SOURCE
I'm working with Eclipse ADT and Android ndk 5b. My correct path to the project is android-ndk-5b/samples/project
When you import from existing source you have to choose a correct target, I use Android 2.3.3.
After, I've updated my project from command line, look this link, http://developer.android.com/sdk/ndk/overview.html
From the samples path write: android update project -p . -s and $Your_Path_Android_ndk/ndk-build
Finally, only run as android app in Eclipse and it's done
It seems that with Eclipse Juno, you can now
Click File | New | Project...
Under Android category select Android Project from Existing Code and click Next.
In Root Directory you can then browse and confirm your sample project location.
From here, Eclipse can automatically detect the jni and find the projects.
If this didn't work, go to terminal or command prompt and navigate to your project root directory (where you see jni folder). Then input
android update project -p . -t <your target level>
Here should be, e.g., android-9
After this, try again the initial steps.

Resources