[HSP3Dishメモ]ソース・オプション5は現在サポートされていません。7以降を使用してください。ターゲット・オプション5は現在サポートされていません。7以降を使用してください。
しばらく仕事以外でHSPを触る機会がなかったのですが、甥っ子用にAndroidアプリを作ってほしいとの依頼があり、久々に扱ってみました。
5年位前?にHSP3DishでAndroidアプリを作成し、自分の子供用に使っていましたが、それの甥っ子版を作ってほしいとの事。
過去のソースがなく(笑)、新しく作り始めるにあたって、最新版のバージョンで試してみようと思ったら、がっつりとはまってしまったという話です。
(これを書いてる時点で、まだ甥っ子のもとには届いてません…
☆事前条件
各種バージョン等
HSP:ver3.6beta3
JAVA:C:\android\jdk-14.0.2
SDK:C:\android\android-sdk\sdk
NDK:C:\android\android-ndk-r21b
ANT:C:\android\apache-ant-1.9.15
プロジェクト:C:\android
SDKフォルダ
C:\android\android-sdk\sdk\system-images
┣android-17
┣android-19
┣android-23
┗android-29 ←使ってるのはこれになる
HSP3Dish Helper ver1.74
プロジェクト名:pokemon
ID:"android-29"
パッケージ名:net.kanalabo.pokemon
■AdMobを使用する(チェックON)
□ARM64をビルドしない(チェックOFF)
□x86をビルドしない(チェックOFF)
□HGIMG4を使用する(チェックOFF)
□センサーを使用する(チェックOFF)
とりあえず、環境構築として、以下ソースで試す。
#include "hsp3dish.as" redraw 0 color 255,0,255:boxf color 0,0,0:print "hello world" redraw 1
これを「HSP3Dish helper」で「ビルド」した結果が↓
[x86_64] SharedLibrary : libpokemon.so [x86_64] Install : libpokemon.so => libs/x86_64/libpokemon.so Buildfile: C:\android\pokemon\build.xml -set-mode-check: -set-debug-files: -check-env: [checkenv] Android SDK Tools Revision 25.2.5 [checkenv] Installed at C:\android\android-sdk\sdk -setup: [echo] Project Name: pokemon [gettype] Project Type: Application -set-debug-mode: -debug-obfuscation-check: -pre-build: -build-setup: [getbuildtools] Using latest Build Tools: 29.0.3 [echo] Resolving Build Target for pokemon… [gettarget] Project Target: Android 10 [gettarget] API level: 29 [echo] ---------- [echo] Creating output directories if needed… [mkdir] Created dir: C:\android\pokemon\bin [mkdir] Created dir: C:\android\pokemon\bin\res [mkdir] Created dir: C:\android\pokemon\bin\rsObj [mkdir] Created dir: C:\android\pokemon\bin\rsLibs [mkdir] Created dir: C:\android\pokemon\gen [mkdir] Created dir: C:\android\pokemon\bin\classes [mkdir] Created dir: C:\android\pokemon\bin\dexedLibs [echo] ---------- [echo] Resolving Dependencies for pokemon… [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'… [subant] No sub-builds to iterate on -code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files… [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files… [echo] ---------- [echo] Handling Resources… [aapt] Generating resource IDs… [echo] ---------- [echo] Handling BuildConfig class… [buildconfig] Generating BuildConfig class. -pre-compile: -compile: [javac] Compiling 4 source files to C:\android\pokemon\bin\classes [javac] エラー: ソース・オプション5は現在サポートされていません。7以降を使用してください。 [javac] エラー: ターゲット・オプション5は現在サポートされていません。7以降を使用してください。 BUILD FAILED C:\android\android-sdk\sdk\tools\ant\build.xml:716: The following error occurred while executing this line: C:\android\android-sdk\sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details. Total time: 9 seconds
途中、もろもろの試行錯誤は置いといて、結果としてはJavaのバージョンを変更する事で解決しました。
JAVA:C:\android\jdk-14.0.2
↓
JAVA:C:\Program Files\Java\jdk1.8.0_131
もしかしたら少し古いバージョンでも解決できたかもしれないですが、過去使っていたJDK(1.8.0_131)に変更したら治ったので、それ以上の調査は未実施。
以下は成功時のログ。途中エラーっぽいのもあるけどとりあえずこれも放置。
[x86_64] SharedLibrary : libpokemon.so [x86_64] Install : libpokemon.so => libs/x86_64/libpokemon.so Buildfile: C:\android\pokemon\build.xml -set-mode-check: -set-debug-files: -check-env: [checkenv] Android SDK Tools Revision 25.2.5 [checkenv] Installed at C:\android\android-sdk\sdk -setup: [echo] Project Name: pokemon [gettype] Project Type: Application -set-debug-mode: -debug-obfuscation-check: -pre-build: -build-setup: [getbuildtools] Using latest Build Tools: 29.0.3 [echo] Resolving Build Target for pokemon… [gettarget] Project Target: Android 10 [gettarget] API level: 29 [echo] ---------- [echo] Creating output directories if needed… [mkdir] Created dir: C:\android\pokemon\bin [mkdir] Created dir: C:\android\pokemon\bin\res [mkdir] Created dir: C:\android\pokemon\bin\rsObj [mkdir] Created dir: C:\android\pokemon\bin\rsLibs [mkdir] Created dir: C:\android\pokemon\gen [mkdir] Created dir: C:\android\pokemon\bin\classes [mkdir] Created dir: C:\android\pokemon\bin\dexedLibs [echo] ---------- [echo] Resolving Dependencies for pokemon… [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'… [subant] No sub-builds to iterate on -code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files… [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files… [echo] ---------- [echo] Handling Resources… [aapt] Generating resource IDs… [echo] ---------- [echo] Handling BuildConfig class… [buildconfig] Generating BuildConfig class. -pre-compile: -compile: [javac] Compiling 4 source files to C:\android\pokemon\bin\classes [javac] 警告: [options] ソース値1.5は廃止されていて、今後のリリースで削除される予定です [javac] 警告: [options] ターゲット値1.5は廃止されていて、今後のリリースで削除される予定です [javac] 警告: [options] 廃止されたオプションについての警告を表示しないようにするには、-Xlint:オプションを使用します。 [javac] 注意:C:\android\pokemon\src\tv\hsp\HspActivity.javaは非推奨のAPIを使用またはオーバーライドしています。 [javac] 注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。 [javac] 警告3個 -post-compile: -obfuscate: -dex: [dex] input: C:\android\pokemon\bin\classes [dex] input: C:\android\pokemon\libs\android-support-compat.jar [dex] input: C:\android\pokemon\libs\google-play-services-clearcut.jar [dex] input: C:\android\pokemon\libs\google-play-services-base.jar [dex] input: C:\android\pokemon\libs\org.apache.http.legacy.jar [dex] input: C:\android\pokemon\libs\google-play-services-gass.jar [dex] input: C:\android\pokemon\libs\android-support-v4.jar [dex] input: C:\android\pokemon\libs\android-support-core-utils.jar [dex] input: C:\android\pokemon\libs\google-play-services-ads.jar [dex] input: C:\android\pokemon\libs\android-support-annotations.jar [dex] input: C:\android\pokemon\libs\google-firebase-common.jar [dex] input: C:\android\pokemon\libs\google-firebase-iid.jar [dex] input: C:\android\pokemon\libs\google-play-services-basement.jar [dex] input: C:\android\pokemon\libs\android-support-core-ui.jar [dex] input: C:\android\pokemon\libs\android-support-media-compat.jar [dex] input: C:\android\pokemon\libs\google-play-services-ads-lite.jar [dex] input: C:\android\pokemon\libs\google-play-services-tasks.jar [dex] input: C:\android\pokemon\libs\android-support-fragment.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-compat.jar -> android-support-compat-8abe0fa43b6b29804d8a525f2bc7d37a.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-clearcut.jar -> google-play-services-clearcut-e59ce6533c35999afd04ab61b79a34a3.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-base.jar -> google-play-services-base-f575e797a3733edfe82ae4a7717c0afd.jar [dex] Pre-Dexing C:\android\pokemon\libs\org.apache.http.legacy.jar -> org.apache.http.legacy-3ea502af9bdf3fa51530a8da36b6dda3.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-gass.jar -> google-play-services-gass-eafd2de9e97199b4a137ffc01d5a0c35.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-v4.jar -> android-support-v4-71ddb929cd1d86e9dadbdd77938ad7fa.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-core-utils.jar -> android-support-core-utils-ee7257077a7b671aa3bda7ea4fb38db6.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-ads.jar -> google-play-services-ads-6dfc33b3fc5545e0869478080eaf4513.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-annotations.jar -> android-support-annotations-c0cc9b2b60354477c81a9484f1097d6d.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-firebase-common.jar -> google-firebase-common-b7f3b4ec38631ab1f2c9251d19951c3d.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-firebase-iid.jar -> google-firebase-iid-970148b3e88ff49a9f4e21cb8db26c6f.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-basement.jar -> google-play-services-basement-37885d8991d936c6c773fe09c6127978.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-core-ui.jar -> android-support-core-ui-272dcf5320a51e6cb86fdee41e8e2e4c.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-media-compat.jar -> android-support-media-compat-0467f0a648884f14415587d40d1e74dc.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-ads-lite.jar -> google-play-services-ads-lite-3c662e363bf56c06be58a218729340d3.jar [dex] Pre-Dexing C:\android\pokemon\libs\google-play-services-tasks.jar -> google-play-services-tasks-714afbeb6a376688c45c5b54621a39ef.jar [dex] Pre-Dexing C:\android\pokemon\libs\android-support-fragment.jar -> android-support-fragment-32877338b1b57bca99c4496e44c04197.jar [dex] Converting compiled files and external libraries into C:\android\pokemon\bin\classes.dex… [dx] Merged dex #1 (22 defs/19.0KiB) [dx] Merged dex #2 (47 defs/8.6KiB) [dx] Merged dex #3 (687 defs/596.9KiB) [dx] Merged dex #4 (138 defs/248.2KiB) [dx] Merged dex #5 (70 defs/99.0KiB) [dx] Merged dex #6 (66 defs/158.0KiB) [dx] Merged dex #7 (214 defs/212.9KiB) [dx] Merged dex #8 (1 defs/0.7KiB) [dx] Merged dex #9 (17 defs/20.1KiB) [dx] Merged dex #10 (17 defs/36.0KiB) [dx] Merged dex #11 (785 defs/1007.5KiB) [dx] Merged dex #12 (382 defs/281.4KiB) [dx] Merged dex #13 (314 defs/281.1KiB) [dx] Merged dex #14 (318 defs/318.6KiB) [dx] Merged dex #15 (32 defs/41.2KiB) [dx] Merged dex #16 (10 defs/9.4KiB) [dx] Merged dex #17 (29 defs/20.9KiB) [dx] Merged dex #18 (420 defs/241.9KiB) [dx] Result is 3569 defs/4298.4KiB. Took 0.8s -crunch: [crunch] Crunching PNG Files in source dir: C:\android\pokemon\res [crunch] To destination dir: C:\android\pokemon\bin\res [crunch] Processing image to cache: C:\android\pokemon\res\drawable-hdpi\ic_launcher.png => C:\android\pokemon\bin\res\drawable-hdpi\ic_launcher.png [crunch] (processed image to cache entry C:\android\pokemon\bin\res\drawable-hdpi\ic_launcher.png: 76% size of source) [crunch] Processing image to cache: C:\android\pokemon\res\drawable-ldpi\ic_launcher.png => C:\android\pokemon\bin\res\drawable-ldpi\ic_launcher.png [crunch] (processed image to cache entry C:\android\pokemon\bin\res\drawable-ldpi\ic_launcher.png: 0% size of source) [crunch] Processing image to cache: C:\android\pokemon\res\drawable-mdpi\ic_launcher.png => C:\android\pokemon\bin\res\drawable-mdpi\ic_launcher.png [crunch] (processed image to cache entry C:\android\pokemon\bin\res\drawable-mdpi\ic_launcher.png: 80% size of source) [crunch] Processing image to cache: C:\android\pokemon\res\drawable-xhdpi\ic_launcher.png => C:\android\pokemon\bin\res\drawable-xhdpi\ic_launcher.png [crunch] (processed image to cache entry C:\android\pokemon\bin\res\drawable-xhdpi\ic_launcher.png: 69% size of source) [crunch] Crunched 4 PNG files to update cache -package-resources: [aapt] Creating full resource package… -package: [apkbuilder] Current build type is different than previous build: forced apkbuilder run. [apkbuilder] Creating pokemon-debug-unaligned.apk and signing it with a debug key… -post-package: -do-debug: [zipalign] Running zip align on final apk… [echo] Debug Package: C:\android\pokemon\bin\pokemon-debug.apk [propertyfile] Creating new property file: C:\android\pokemon\bin\build.prop [propertyfile] Updating property file: C:\android\pokemon\bin\build.prop [propertyfile] Updating property file: C:\android\pokemon\bin\build.prop [propertyfile] Updating property file: C:\android\pokemon\bin\build.prop -post-build: debug: BUILD SUCCESSFUL Total time: 1 minute 37 seconds