我按照this链接中给出的步骤从命令行构建Android程序。
以下是我使用的脚本的初始部分。
ANDROID_HOME=/home/tom/Downloads/adt-bundle-linux-x86_64-20130522
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
DEV_HOME=/home/tom/Downloads/tom/generated_assimilators/
args=("$@")
DEV_HOME=$DEV_HOME${args[0]}
PACKAGE_NAME=${args[1]}
#convert package name org/example(this is how given as input) to org.example
CONVERT_PACKAGE=${PACKAGE_NAME////.}
#Creating New android project
$ANDROID_HOME/tools/android create project --name ${args[0]} --path $DEV_HOME --target android-16 --package $CONVERT_PACKAGE --activity ${args[0]}
#Copying source files into our newly created project
src=/home/tom/Downloads/tom/fwdmusicassimilator/Script_May6
if test -d $DEV_HOME/assets;
then
echo "DIR exist"
else
echo "DIR not exists"
mkdir $DEV_HOME/assets
fi
当我在终端中运行上面的脚本时,我得到以下输出,它指出tom/Downloads/adt-bundle-linux-x86_64-20130522/tools/android
不存在的事实。我从android开发者网站下载了64位ubuntu的最新android sdk。
此脚本以前在其他计算机上没有任何问题时工作得很完美。现在,当我将其移植到生产环境时,我从android开发者网站获得了最新的sdk问题。我现在已经很久没有这么做了,我真的很感激任何帮助,建议或评论,可以帮助我解决这个问题并让我摆脱这个时代的杀手。
tom@tom-Inspiron-N4050:~/Downloads/tom/fwdmusicassimilator$ ./test_final_6jun.sh mu com/test
./test_final_6jun.sh: line 15: /home/tom/Downloads/adt-bundle-linux-x86_64-20130522/tools/android: No such file or directory
DIR not exists
mkdir: cannot create directory `/home/tom/Downloads/tom/generated_assimilators/mu/assets': No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/AddPlaylist.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/DataBaseHelper.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/DownloadAudioFile.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/MainPerspectivesListActivity.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/MusicListActivity.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/MusicPlayerActivity.java: No such file or directory
./test_final_6jun.sh: line 32: /home/tom/Downloads/tom/generated_assimilators/mu/src/com/test/PlaylistSongsSelectActivity.java: No such file or directory
修改
根据Commonsware在下面指出的内容,作为对我的问题的评论,我进行了必要的更正,这是带有以/adt-bundle-linux-x86_64-20130522/platform-tools/aapt: No such file or directory
开头的错误的终端日志
tom@tom-Inspiron-N4050:~$ cd /home/tom/Downloads/tom/fwdmusicassimilator
tom@tom-Inspiron-N4050:~/Downloads/tom/fwdmusicassimilator$ ./test_final_6jun.sh music88 com/abc
Created project directory: /home/tom/Downloads/tom/generated_assimilators/music88
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc
Added file /home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/music88.java
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/bin
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/libs
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/values
Added file /home/tom/Downloads/tom/generated_assimilators/music88/res/values/strings.xml
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/layout
Added file /home/tom/Downloads/tom/generated_assimilators/music88/res/layout/main.xml
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/drawable-xhdpi
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/drawable-hdpi
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/drawable-mdpi
Created directory /home/tom/Downloads/tom/generated_assimilators/music88/res/drawable-ldpi
Added file /home/tom/Downloads/tom/generated_assimilators/music88/AndroidManifest.xml
Added file /home/tom/Downloads/tom/generated_assimilators/music88/build.xml
Added file /home/tom/Downloads/tom/generated_assimilators/music88/proguard-project.txt
DIR not exists
no files to copy
no files to copy
no files to copy
no files to copy
Does not exist
Generating 1,024 bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of 10,000 days
for: CN=company name, OU=organisational unit, O=organisation, L=location, ST=state, C=country code
[Storing /home/tom/Downloads/tom/generated_assimilators/music88/AndroidTest.keystore]
./test_final_6jun.sh: line 176: /home/tom/Downloads/adt-bundle-linux-x86_64-20130522/platform-tools/aapt: No such file or directory
DIR not exists
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/AddPlaylist.java]]
[parsing completed 15ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/DataBaseHelper.java]]
[parsing completed 16ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/DownloadAudioFile.java]]
[parsing completed 2ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/MainPerspectivesListActivity.java]]
[parsing completed 2ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/music88.java]]
[parsing completed 3ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/MusicListActivity.java]]
[parsing completed 9ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/MusicPlayerActivity.java]]
[parsing completed 10ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/PlaylistSongsSelectActivity.java]]
[parsing completed 5ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/SongPlayService.java]]
[parsing completed 4ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/SongsActivity.java]]
[parsing completed 0ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/SpecificPerspectiveListActivity.java]]
[parsing completed 6ms]
[parsing started RegularFileObject[/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/Utilities.java]]
[parsing completed 1ms]
[search path for source files: /home/tom/Downloads/tom/generated_assimilators/music88/src]
[search path for class files: /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/resources.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/sunrsasign.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jsse.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jce.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/charsets.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/netx.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/plugin.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rhino.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/modules/jdk.boot.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/classes,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/sunpkcs11.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/pulse-java.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/localedata.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/dnsns.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/sunjce_provider.jar,/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/java-atk-wrapper.jar,/home/tom/Downloads/adt-bundle-linux-x86_64-20130522/platforms/android-16/android.jar,/home/tom/Downloads/tom/generated_assimilators/music88/obj]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-6-openjdk-amd64/lib/ct.sym(META-INF/sym/rt.jar/java/io/IOException.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-6-openjdk-amd64/lib/ct.sym(META-INF/sym/rt.jar/java/util/ArrayList.class)]]
/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/AddPlaylist.java:6: package android.app does not exist
import android.app.ActionBar;
^
/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/AddPlaylist.java:7: package android.app does not exist
import android.app.Activity;
^
/home/tom/Downloads/tom/generated_assimilators/music88/src/com/abc/AddPlaylist.java:8: package android.content does not exist
import android.content.Intent;
^
答案 0 :(得分:2)
最新的Android SDT将一些工具移至build-tools
文件夹,将其他工具移至platform-tools
文件夹:您可能要尝试将文件从那里复制到您期望的文件夹,或指向到了正确的地方。