Unable to locate tools.jar Fedora - android

I'm trying to compile my python game to run on android using PGS4A and I'm getting this error
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.7.0-openjdk- 1.7.0.60-2.4.7.0.fc20.x86_64/lib/tools.jar
There are a bunch of solutions for this on Windows but I can't find one for fedora.
I have the /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.7.0.fc20.x86_64/ but nothing else

Assuming you are using the Java that comes packaged with Fedora (some version of OpenJDK) you probably need to install the appropriate -devel package.
Here's an example of what you would do on my Fedora 20 workstation:
$ rpm -qa|grep openjdk
java-1.7.0-openjdk-headless-1.7.0.60-2.4.7.0.fc20.x86_64
java-1.7.0-openjdk-1.7.0.60-2.4.7.0.fc20.x86_64
$ sudo yum install java-1.7.0-openjdk-devel
...
The first command tells me what Java I'm using (1.7.0, since 1.8.0 is another option) and the second command asks it to install the development libraries, which includes tools.jar, among other things.
But I should add that my /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.7.0.fc20.x86_64 directory does contain a few things:
-r--r--r--. 1 root root 172252 Apr 16 02:58 THIRD_PARTY_README
-r--r--r--. 1 root root 19263 Apr 16 02:58 LICENSE
-r--r--r--. 1 root root 1503 Apr 16 02:58 ASSEMBLY_EXCEPTION
drwxr-xr-x. 3 root root 4096 Apr 20 19:09 jre-abrt
drwxr-xr-x. 4 root root 4096 Apr 20 19:09 jre

Related

Android CI using Bitbucket Pipelines and Docker

I am trying to set up Continuous Integration (CI) in Bitbucket Pipelines for Android.
I have created a sample blank activity using Android Studio 2.1.1.
With Pipelines I'm using the uber/android-build-environment Docker container which creates the environment nicely. Here is my bitbucket-pipelines.yml
image: uber/android-build-environment:latest
pipelines:
default:
- step:
script:
- echo y | android update sdk --filter "extra-android-m2repository" --no-ui -a # Grab the Android Support Repo which isn't included in the container
- ./gradlew assembleDebug
Some changes are needed since uber/android-build-environment is expecting to be run like so:
docker run -i -v $PWD:/project -t uber/android-build-environment /bin/bash /project/ci/build.sh
For example, the source is not copied to the volume /project but instead Pipelines copies the contents of the Bitbucket repo to the working directory of the container at:
/opt/atlassian/bitbucketci/agent/build
And when ./gradlew assembleDebug is run I get the following error:
...
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type TaskArtifactStateCacheAccess using TaskExecutionServices.createCacheAccess().
> Failed to create parent directory '/opt/atlassian/bitbucketci/agent/build/.gradle' when creating directory '/opt/atlassian/bitbucketci/agent/build/.gradle/2.10/taskArtifacts'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 56.449 secs
Running ls -al in the working directory gives:
ls -al
total 52
drwxr-xr-x 5 root root 4096 May 31 22:33 .
drwxr-xr-x 3 root root 4096 May 31 22:43 ..
drwxr-xr-x 3 root root 4096 May 31 22:33 app
-rw-r--r-- 1 root root 462 May 31 22:33 bitbucket-pipelines.yml
-rw-r--r-- 1 root root 498 May 31 22:33 build.gradle
drwxr-xr-x 8 root root 4096 May 31 22:33 .git
-rw-r--r-- 1 root root 387 May 31 22:33 .gitignore
drwxr-xr-x 3 root root 4096 May 31 22:33 gradle
-rw-r--r-- 1 root root 855 May 31 22:33 gradle.properties
-rwxr-xr-x 1 root root 4971 May 31 22:33 gradlew
-rw-r--r-- 1 root root 2314 May 31 22:33 gradlew.bat
-rw-r--r-- 1 root root 15 May 31 22:33 settings.gradle
It's a bug in their system , I report it(issue url, it's quite long) to them and they have fixed it (fix url).I have tested on my project and it successfully build.Try to build your project now and good luck.
It looks like uber/android-build-environment is not supported anymore.
I ended up using javiersantos/android-ci instead which works perfectly from scratch.
Just add the following content to bitbucket-pipeline.yml:
image: javiersantos/android-ci:27.0.3
pipelines:
default:
- step:
script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew
- ./gradlew assembleDebug
Could you symlink your project from /opt/atlassian/bitbucketci/agent/build to /project from within the container? ln -s /opt/atlassian/bitbucketci/agent/build /project is the command you'll need.
or alternatively copy the files to the new path?
I have no experience with android development, so YMMV :)

zipalign: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

I am trying to build android app. When I run the zip align tool to optimize the APK, I get this error message:
zipalign: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory
I tried to install libc++
sudo aptitude install libc++
it says: Couldn't find package "libc+".
Snapshot of my terminal
If your system is 64-bits, there should be a folder lib64 on the path of
[android-path]/build-tools/[version]/
The files in lib64 are
[ec2-user 25.0.2]$ ll lib64/
total 51628
-rwxrwxrwx 1 ec2-user ec2-user 30712616 Dec 23 07:22 libLLVM.so
-rwxrwxrwx 1 ec2-user ec2-user 482522 Dec 23 07:22 libbcc.so
-rwxrwxrwx 1 ec2-user ec2-user 433914 Dec 23 07:22 libbcinfo.so
-rwxrwxrwx 1 ec2-user ec2-user 1211614 Dec 23 07:22 libc++.so
-rwxrwxrwx 1 ec2-user ec2-user 20019608 Dec 23 07:22 libclang.so
Just copy the folder lib64 and zipalign program together to the destination path, and you can run the zipalign correctly. It worked for me. I guess the zipalign has a dependency on the files in lib64 folder.
I met the same problems and google it. You can try the following suggestions:
If you are in 64-bit environment, try: sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev.
Update the latest android sdk tools and do not move the zipalign binary to any other folder. It solve my problem.
I had the exact same problem and it was probably because I moved the zipalign binary from <android-path>/build-tools/23.0.3 to <android-path>/tools.
The solution is to add the build-tools/23.0.3 dir to your path:
export PATH=${PATH}:<android-path>/build-tools/23.0.3

How to compile aFreeRDP on Linux

aFreeRDP is the Android client of the FreeRDP project.
I'm using 64 bit Ubuntu 15.04 Vivid.
My goal is to compile aFreeRDP. I'm at the finish line, but cannot cross it. I successfully installed the required packages, Android NDK, and then compiled the external openssl (the android shell script does that automatically). Then I generated make files. Interestingly neither
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/AndroidToolchain.cmake -DANDROID_NDK=/home/csaba/android-ndk -DFREERDP_EXTERNAL_SSL_PATH=/home/csaba/GitRepos/FreeRDP/external/openssl -DANDROID_SDK=/home/csaba/android-sdk-linux
nor
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/AndroidToolchain.cmake -DANDROID_NDK=/home/csaba/android-ndk -DFREERDP_EXTERNAL_SSL_PATH=/home/csaba/GitRepos/FreeRDP/external/openssl -DCMAKE_BUILD_TYPE=Debug -DANDROID_BUILD_JAVA=OFF -DANDROID_SDK=/home/csaba/android-sdk-linux -DFREERDP_EXTERNAL_JPEG_PATH=/home/csaba/GitRepos/FreeRDP/external/jpeg8d
produced any apk, but they happily compiled libfreerdp-android.so.
I need an apk, so I went to the client/Android/aFreeRDP and since I had a build.xml there, I said ant build install. The build process started, but then died at the resource compilation phase. I have the current level 23 android build tools and companion stuff with the Android SDK. I see in the source, that the source was originally targeted to level 21. I added level 21 SDK too, and tried to force maxSdkVersion to 21 in the AndroidManifest.xml, but that didn't help. The compilation log:
http://pastebin.com/Nc0mqGrQ
As you can see after resource errors
[aapt] Generating resource IDs...
[aapt] /home/csaba/GitRepos/FreeRDP/client/Android/appcompat_v7/res/values-v23/styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
[aapt]
[aapt] /home/csaba/GitRepos/FreeRDP/client/Android/appcompat_v7/res/values-v23/styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
[aapt]
it dies
BUILD FAILED
/home/csaba/android-sdk-linux/tools/ant/build.xml:597: The following error occurred while executing this line:
/home/csaba/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/csaba/android-sdk-linux/tools/ant/build.xml:694: null returned: 1
Comparing the level 21 and the level 23 resources, the level 21 has way more stuff, the level 23 has single entries, very vague. How can I fix this? Let me know what files should I post.
Update 1:
Get rid of an annoying issue with ADT, which could have affected this bug too: Eclipse Error: Error parsing ...\android-22\android-wear\armeabi-v7a\devices.xml
Unfortunately uninstalling the Wear images made the ADT error go away, but the aFreeRDP compilation error still remained.
Update 2:
I tried to go back in time and my goal was to have an Android SDK which provides 21, but doesn't have level 23.
I backed up my current Android SDK. SDK download tgz 22.6.2 (https://dl.google.com/android/android-sdk_r22.6.2-linux.tgz) only provides target 21. But SDK download tgz 23.0.0 (https://dl.google.com/android/android-sdk_r23-linux.tgz) already wants to upgrade to 24. So I cannot get the system to a state, when I don't have the target 23 (which indirectly causes errors somehow - more correctly, the level 24's compatibility facility for target 23 (which satisfies target 21)), but have the target 21.
(Bonus question: why Google makes it so hard to download older SDKs? I had to fiddle and guess URLs).
Update 3:
I managed to debug aFreeRDP from Android Studio (v 1.5) using the directions github.com/FreeRDP/FreeRDP/blob/master/docs/README.android
I want to post the same topic but you already made one so I will post here.
it should be comment but I dont have 50 reputation to comment so i make it answer here: Notes: (xxx = https://github.com in this post)
Reference Links:
xxx/FreeRDP/FreeRDP/wiki/Compilation
xxx/awakecoding/FreeRDP-Manuals/blob/master/Developer/FreeRDP-Developer-Manual.markdown
and other posts from internet
Goal: Build aFreeRDP for Android devices.
2 years ago I used to build it for Ubuntu 12 / 14 but now the build is broken.
A new environment needs to setup again:
-Windows 7 Enterprise 64 bit (MAIN OS)
-WMware WorkStation 10
-VM Ubuntu 15.10 Wily 64bit
Prepare Ubuntu with NDK10e, JDK7, SDK23...
shaun#ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
Install JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Install ANDROID NDK
chmod a+x android-ndk-r10e-linux-x86_64.bin
./android-ndk-r10e-linux-x86_64.bin
sudo chown -R root:root /home/shaun/Main/android-ndk-r10e
sudo mv /home/shaun/Main/android-ndk-r10e /opt
export NDK=/opt/android-ndk-r10e
Install ANDROID SDK
Download and extract android-sdk_r23.0.2-linux.tgz
sudo mv /home/shaun/Main/android-sdk-linux /opt/android-sdk
shaun#ubuntu:/opt/android-sdk/tools$ ./android
Install dependences GIT / CMAKE / GCC
sudo apt-get install \
build-essential git-core cmake \
libssl-dev \
libx11-dev libxext-dev libxinerama-dev libxcursor-dev libxkbfile-dev \
libxv-dev libxi-dev libxdamage-dev libxrender-dev libxrandr-dev \
libasound2-dev libcups2-dev libpulse-dev \
libavutil-dev libavcodec-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libcunit1-dev libdirectfb-dev xmlto doxygen libxtst-dev
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
GET FreeRDP
git clone git://github.com/FreeRDP/FreeRDP.git
cd FreeRDP
Add PATH
shaun#ubuntu:~$ gedit ~/.bashrc
export ANDROID_NDK=/opt/android-ndk-r10e
export ANDROID_SDK=/opt/android-sdk
export FREERDP_EXTERNAL_SSL_PATH=/home/shaun/Main/FreeRDP-master/external/Android-external-openssl-ndk-static
export PATH=$PATH:$FREERDP_EXTERNAL_SSL_PATH
export PATH="$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK"
from FreeRDP-->run ./scripts/android_setup_build_env.sh
--> see long output .... then at the end you see:
Prepared external libraries, you can now build the application.
Finally run:
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/AndroidToolchain.cmake -DANDROID_NDK=$ANDROID_NDK -DANDROID_SDK=$ANDROID_SDK -DFREERDP_EXTERNAL_SSL_PATH=$FREERDP_EXTERNAL_SSL_PATH -DFREERDP_EXTERNAL_JPEG_PATH="/home/shaun/Main/FreeRDP/external/jpeg8d" -DANDROID_NATIVE_API_LEVEL:STRING=L -DCMAKE_MAKE_PROGRAM=$ANDROID_NDK/prebuilt/linux-x86/bin/make -DCMAKE_BUILD_TYPE=Debug -DANDROID_BUILD_JAVA=OFF -L .
make
After this make, I have all libs i need but still fail to have APK:...
...long output....
Total time: 2 seconds
client/Android/aFreeRDP/CMakeFiles/android-package.dir/build.make:50: recipe for target 'client/Android/aFreeRDP/bin/aFreeRDP-debug.apk' failed
make[2]: * [client/Android/aFreeRDP/bin/aFreeRDP-debug.apk] Error 1
CMakeFiles/Makefile2:2494: recipe for target 'client/Android/aFreeRDP/CMakeFiles/android-package.dir/all' failed
make[1]: * [client/Android/aFreeRDP/CMakeFiles/android-package.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2
==========================
Import to ECLIPSE and build from Eclipse sucessfully -- APK and application run on all my devices again with new features most advanced feature is microphone redirection works as well :-)
But Still not work in ANDROID STUDIO , Still trying :(, please let me know if you have it work in AS. Thanks
I started with the 23.0 SDK tgz, upgraded one round (not upgrading up to Android 6.0). Then the troublesome xml files are copied over from the Android SDK. So I deleted that values-v23 folder from the SDK. I also modified the AndroidManifest.xml of the aFreeRDP and set minSdkVersion to 17 from 14. The directory deletion certainly helped, I'm not sure if the other two steps contributed, but I have an apk now. I consider this an ugly hack, only a workaround though. Because So I won't mark this as an answer for now.
Update:
I started from a totally updated Android SDK, and the minSdkVersion bump from 14 to 17 also doesn't matter. The only thing which made the error go away is the invasive removal of that values-v23 directory from inside the Android SDK.
Note:
The compilation is simpler than it was a year/couple of years ago. The android_setup_build_env.sh takes care of downloading and compiling ssl library and other stuff.

Gradle Error 2 in Android project even file exists

I've generated android project with gradle support in IntelliJ. I have arch linux, on my friend's computer who has Windows everything is ok. On my computer I cannot build project, I get following error:
Error:Gradle: Execution failed for task ':app:mergeDebugResources'.
/home/hubert/IdeaProjects/AGHacks/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png: Error: Cannot run program "/home/hubert/bin/android-sdk/android-sdk-linux/build-tools/21.0.1/aapt": error=2, No such file or directory
And both file exists:
➜ IdeaProjects ls -al /home/hubert/IdeaProjects/AGHacks/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png
-rw-r--r-- 1 hubert hubert 188 Oct 22 22:51 /home/hubert/IdeaProjects/AGHacks/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png
➜ IdeaProjects ls -al /home/hubert/bin/android-sdk/android-sdk-linux/build-tools/21.0.1/aapt
-rwxrwxrwx 1 hubert hubert 1248409 Oct 21 21:29 /home/hubert/bin/android-sdk/android-sdk-linux/build-tools/21.0.1/aapt`
What am I doing wrong?
I needed to install 32bit version of libc++ and other applications.

Unable to see the source tree through Finder while doing repo sync in OSX

I am downloading the android source as per the instructions mentioned in source.android.com. I have made a different case sensitive file system and have made a directory in it and doing a repo sync. I can see through terminal ls -la
the following files
Aruns-MacBook-Pro:ANDROID_DIR ArunAbraham$ ls -la
total 0
drwxr-xr-x 3 ArunAbraham staff 102 May 14 17:26 .
drwxr-xr-x 5 ArunAbraham staff 340 May 14 17:23 ..
drwxr-xr-x 6 ArunAbraham staff 238 May 14 17:27 .repo
But i can't see the same through the Finder. Is this how it is supposed to behave ?
Could someone explain me this behavior ? Or have i done something wrong ?
Finder treats files starting with a . as hidden files. ls does as well but the -a option you gave overrides it.
Here's a tip to show all hidden files in the Finder, but you will see everything, not just theones you want. Short version:
defaults write com.apple.Finder AppleShowAllFiles YES

Categories

Resources