I'm having issues to create an image database (.imgdb) for my arcore project. I've downloaded arcore sdk for android and inside the folder tools there's arcoreimg for mac. When i try to follow the steps in here:
https://developers.google.com/ar/develop/c/augmented-images/arcoreimg
the following is not working:
./arcoreimg build-db --input_image_list_path=/path/to/image_list_file.txt \
--output_db_path=/path/to/myimages.imgdb
(changing the path to my images obviously)
It says arcoreimg command not found when i execute it in the Terminal. What should i do? Any ideas?
Had the same problem, making the file executable fixed the problem for me:
sudo chmod +x arcoreimg
The official documentation doesn't point to the right steps.
First, locate the arcoreimg file on your system. On MacOS, I found it inside <arcore-sdk-location</arcore-android-sdk/tools/arcoreimg/macos.
You can use the executable directly from here, or copy it to a more convenient location (maybe next to your images).
I copied it next to my images, opened the terminal in the folder, and then used the eval-img command, but the build db command should work the same way-
./arcoreimg eval-img --input_image_path=dog.jpg
This might give permission denied or command not found.
sudo chmod +x arcoreimg should fix this.
Step 1: Give read/write access to your tool. Open your arcoreimg directory from terminal. And give following command
sudo chmod +x arcoreimg
Step 2: Copy your images in one folder
Step 3: Create one empty output folder
Step 4: Give following command
./arcoreimg build-db --input_images_directory="yourInputDirectoryPath" --output_db_path="yourOutputDirectoryPath/databaseName.imgdb"
Sample command
./arcoreimg build-db --input_images_directory=/Users/ranjithkumar/Desktop/input_images --output_db_path=/Users/ranjithkumar/Desktop/output_db/myImages.imgdb
I believe the official documentation on using this may not be very clear, as this portion ./arcoreimg of the sample code refers to the exact directory where your arcoreimage cli tool is located, as well as the name it is called. So you may correctly run the code like this;
/Users/.../GoogleARCore/CLI/augmented_image_cli_osx build-db --input_image_list_path=/path/to/image_list_file.txt \
--output_db_path=/path/to/myimages.imgdb
Related
I installed android studio on my reinstalled 20.10 groovy gorilla. When I run it, I find this error:
And then I get this error if i click cancel:
Please help me solve this error.
Try to open the program from the terminal by entering the directory where the program is stored and typing open -a programNameHere. If that doesn't work, delete and reinstall the sdk.
It is more of a Linux permission related. You might have extracted android studio into /opt as they have mentioned in documentation. I can suggest few solutions.
Extract android studio in home directory of user. Make sure not to use sudo or root to extract tar. Since you are extracting in user home directory, you don't have to use root.
OR
Install (extract) Android Studio in /opt with proper permissions.
Create a new directory in /opt/android, using sudo mkdir /opt/android.
Change ownership of /opt/android directory to the current user, using sudo chown -R <USERNAME> /opt/android. Replace <USERNAME> with the current username.
Extract android studio tar file in /opt/android directory. Don't use sudo or root extract files.
PS: Above mentioned solution no. 2 is dirty solution. /opt directory is used for multi user application. To allow multiple user, we have to create system account and add current user to newly created account's group. If you are not looking for multiuser solution then go with solution 1
I downloaded Android Studio 2.3.3 for Linux and unzipped the content to /usr/local
then
$ cd android-studio/bin
Edited the file idea.properties and appended a following line to it:
disable.android.first.run=true
Then launched Android Studio:
$ sudo sh studio.sh
Looking in classpath from com.intellij.util.lang.UrlClassLoader#1a7cec2 for /com/sun/jna/linux-x86/libjnidispatch.so
Found library resource at jar:file:/usr/local/android-studio/lib/jna.jar!/com/sun/jna/linux-x86/libjnidispatch.so
Trying /root/.AndroidStudio2.3/system/tmp/jna5562911082428971611.tmp
Found jnidispatch at /root/.AndroidStudio2.3/system/tmp/jna5562911082428971611.tmp
[ 40066] WARN - dea.updater.SdkComponentSource - File /root/.android/repositories.cfg could not be loaded.
^C[18124266] WARN - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 130
And it will stuck. After long waiting I termited it with Ctrl+C
Try attaching to the process with strace to see what it's doing (for example, waiting on a network or file). Or run it with strace like this:
strace -o foo.log -s1024 -f ./studio.sh
After a while, break it with Ctrl-C and examine the log file for syscalls like open, read, recvmsg.
Alternatively, while it's running, you can attach with a Java profiler to the jvm. For a start, you can launch jconsole or jvisualvm and attach to the Android Studio (it will show as an empty name, with only PID) and view stack traces of individual threads. In jvisualvm you can view the CPU usage sample and click on the hot event and see the stack trace.
Basically you need to find out what the app is trying to access for so long. Most likely some network resource.
I think all your problems happen because you ran as root (sudo) on your first run.
So try to unroot before doing a clean install like I suggest below:
Unroot the installation
cd to the folder where you unzipped Android Studio before
cd ..
Recursively change user and group:
sudo find <thedirname> -print0 | xargs -0 chown <yourusername>:<yourgroupname>
cd ~ or cd to go back to home
Recursively change user and group
sudo find .Android* -print0 | xargs -0 chown <yourusername>:<yourgroupname>
(I sudo because you've used root user previously).
Recursively change user and group
sudo find Android* -print0 | xargs -0 chown <yourusername>:<yourgroupname>
cd into the unzipped directory. Do chmod +x studio.sh.
Start Android Studio ./studio.sh
If it didn't help, do a:
Clean install
Download and unzip a fresh copy of Android Studio. I suggest version 3, it's pre released, but stable. It doesn't matter where you put it.
I believe you have Java installed, but make sure you have Java 8 as the default one: in command line: java -version, make sure it's 1.8.
Move any old installations out of the way, in case they are corrupt:
sudo mv ~/.Android* ~/tmp/
sudo mv ~/Android ~/tmp/
should do the trick. (I sudo because you've used root user previously).
cd into the unzipped directory. Do chmod +x studio.sh.
Start Android Studio ./studio.sh
Make sure all the files are owned by your username, and group as well.
I took some information from:
Stuck at “.android/repositories.cfg could not be loaded.”
Installing Android Studio in Ubuntu 14.04 64-Bit .android/repositories.cfg could not be loaded
The answers collectively say that:
Android Studio will run fine without repositories.cfg.
You can remove this warning by putting the following into repositories.cfg:
### User Sources for Android SDK Manager
count=0
After waiting some time it eventually goes beyond that step.
Patience is the key.
So, try waiting a little bit more. It always helps.
This is common. On your first run the gradle files are needed to be downloaded and installed in background. It's about 90 MB in size and even if your internet speed is high, the gradle servers may be slow taking it to maximum of 1 or 2 hours in the worst case. So open Android Studio and wait until it opens. Hope it helps.
I've found a potientaly useful link from AskUbuntu, the guy suggested creating an empty file called repositories.cfg. And that solved it.
Ref: https://askubuntu.com/questions/885658/android-sdk-repositories-cfg-could-not-be-loaded
Just remove /root/.AndroidStudio2.3 and /root/.android (after making a backup)
Maybe it has something to do with the script looking at the root location. Have you tried using chown on the unzipped content directory?
Try this to install
Download the studio
Extract to home
go to android-studio/bin/
Mouse right click than open terminal
type ./studio than press enter
now it will start to install studio. If you installing first time than It will download some files of SDK. and if you have already downloaded SDK than you can cancel download and set you SDK path from the setting from right bottom corner.
try creating repositories.cfg -- Because I see it as warning. Let's see what happens after that!
touch ~/.android/repositories.cfg /* Linux */
Extract your downloaded Android Studio setup zip file to your /home/<user_name> directory and in terminal follow the below commands
$ sudo chmod +x studio.sh
And hit enter
Now run the following command
$ ./studio.sh
And wait for some time to download the required libraries.
When i'm executing "cordova platform add android" the command return this :
Error: /Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin/create: Command failed with exit code EACCES
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:818:12)
I've read that it could be a problem of permission so i've tried to use "sudo cordova platform add android" but the same error is returned.
I also tried to use chmod 777 on my project folder and platforms folder.
I tried to remove the platforms folder, the folder is recreated then same error is returned.
For your information, the commands "java", "ant", "cordova", "npm" are all recognize.
My only guess is that my Path to the SDK is wrong.
Here what i've done :
(I'm on Mac Yosemite for the information)
I downloaded the Standalone SDK tools.
I created a folder /Development/Android and added the unzipped downloaded folder (android-sdk-macosx).
For your information the "platforms" folder is empty.
i added to the /etc/paths the path to /Development/Android/android-sdk-macosx/tools
I'm not sure it should be here, any hints or solutions would be appreciated.
I don't think the problem is on your project. The problem seems to be in
/Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin/create
which doesn't have the necessary rights to be executed. Try to apply something like this command for that folder
chmod -R 777 /Users/brieuc/.cordova/lib/android/cordova/3.6.4/bin
It should give it all rights and thus let create to be executed.
#Brieuc Here is solution for your new problem.
You need to specify Android SDK Path in .profile file located in your home.
In terminal,
sudo nano ~/.profile
Then add these lines at the end, save and close .profile. (You may have different paths for your Android SDK and ANT. ANT Path may not be necessary to set for you right now)
export ANT_HOME=/usr/share/ant
export ANDROID_HOME=/home/sagun/bin/android-sdk
export PATH=$PATH:$ANT_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Now at the terminal, you must notify the OS about the changes you made to .profile
source ~/.profile
If that doesn't do it, restart linux
Now, you may still face some permission issues, for that navigate to your android-sdk/tools and then enter
chmod +x android
Hope this helps you :)
I have been trying to get my head around using uiautomator and I understand creating the test cases. I tried the first two steps of building the JAR according the the Android developer guide for UI Testing (http://developer.android.com/tools/testing/testing_ui.html) and that worked fine, but I am unsure on how to follow the next steps and building the JAR file with ant. Please can anyone help me with this issue.
Here are the steps that I have done so far:
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
set ANDROID_HOME=<path_to_your_sdk>
This is the step that I am stuck on:
ant build
The error I get when I use the command prompt is:
'ant' is not recognized as an internal or external command, operable program or batch file.
In the terminal run
which ant
It seems you do not have ant installed. If no location like /usr/bin/ant shows up after you run the command above, use this to install it:
sudo apt-get install ant
Try again after. It should work.
If you're using ADT, I recommend downloading Apache ant and placing it within the sdk/tools/ant folder. Then change your PATH variable to direct to the ant bin folder.
you have this error because you wrote "ant build" from incorrect path.
I did (this command generate build.xml, local.properties, project.properties files):
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
I changed in build.xml first line like:
<project name="name" default="build">
after that I run ant from eclipse. Build was success.
Have you installed ant? If not then do it from this site: http://ant.apache.org/manual/install.html
If yes then follow these steps:
Navigate to your project directory and means (go to bin of your project)
Using command window execute the function: ant build
Ensure that your default JAVA_HOME points to JDK installation, not the JRE, and check if your compiler is in the PATH. Try to type “javac” in the command prompt. If javac is not found, then you should put your bin directory in the PATH.
For example, in Windows:
SET PATH=c:/jdk1.5.0_07/bin;%PATH%
This site might help further: http://looksok.wordpress.com/2014/02/08/uiautomator-in-eclipse/
If you have ADT with Eclipse then you can find ant in the plugins directory of Eclipse.
So I'm having the same issue as this guy in this question
android' is not recognized as an internal or external command
But when I changed my PATH variable and added the path to android.bat my cmd still does gives
'android' is not recognized as an internal or external command,
operable program or batch file.
My PATH looks like this
D:\Program Files\Java\jdk1.7.0_04\bin;D:\BossGrand\Programing\Ant\apache-ant-1.8.4\bin;C:\Program Files\TortoiseSVN\bin;D:\Program Files\Android\tools
and I made sure android.bat is inside D:\Program Files\Android\tools
I know this because when I go to this directory I can use the android update project command just fine
Does anyone know why I still can't use the android command?
Use the command prompt with admin .It work for me : )
You might have installed Cygwin as part of the SDK. I had the same problem "android.bat is not recognized as an internal or external command". So, Uninstall the Cygwin and try again (you might not able to uninstall Cygwin, since a mysterious “permission denied” when deleting the Cygwin files by default). You need to own access to this mysterious Cygwin files by doing
Take ownership: takeown /r /d y /f cygwin (do this, wherever is your cygwin folder is)
This command takes ownership recursive of the folder, without asking anything and gives Full Access to Everyone recursively in the folder:
icacls cygwin /t /grant Everyone:F And finally, the command which deletes it all and removes Cygwin:
rmdir /s /q cygwin Good bye Cygwin!
Now try again. (This worked for me)
PS: You can always re-install cygwin again. So, nothing wrong giving it a try. Good Luck
you must enter the command with complete arguments
android update project -p .
be carefull you must enter a dot at the end of command.