0

コマンド ラインから 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をダウンロードしました。

このスクリプトは、以前は他のマシンで 1 つの問題もなく完全に機能していました。これを本番環境に移植すると、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;
                  ^
4

1 に答える 1

2

最新の Android SDT では、一部のツールがbuild-toolsフォルダーに移動され、その他のツールがフォルダーに移動platform-toolsされました。そこから目的のフォルダーにファイルをコピーするか、適切な場所を指定してみてください。

于 2013-06-07T14:15:27.093 に答える