以下の記事を参考に、Live2D SDKのAndroidのサンプルアプリをエミュレーションしようとしています。
2021年夏のLive2Dワークショップ
2021年夏のLive2Dワークショップのスライド
エミュレータを実行したところで以下のエラーが出ました。
02/21 07:09:33: Launching 'Demo' on Pixel 2 API 30. Install successfully finished in 3 s 133 ms. Could not identify launch activity: Default Activity not found Error while Launching activity Failed to launch an application on all devices
manifest.xmlは
xml
1<?xml version="1.0" encoding="utf-8"?> 2<manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 package="com.live2d.demo" 4 android:screenOrientation="portrait"> 5 6 <uses-feature android:glEsVersion="0x00020000" android:required="true" /> 7 <uses-feature android:name="android.software.live_wallpaper" android:required="true" /> 8 9 <uses-permission android:name="android.permission.SET_WALLPAPER"/> 10 11 <application 12 android:allowBackup="true" 13 android:icon="@mipmap/ic_launcher" 14 android:label="@string/app_name" 15 android:roundIcon="@mipmap/ic_launcher_round" 16 android:supportsRtl="true" 17 android:theme="@style/AppTheme"> 18 <service 19 android:name="com.live2d.demo.LiveWallpaperService" 20 android:label="@string/title_activity_sample" 21 android:permission="android.permission.BIND_WALLPAPER" > 22 <intent-filter> 23 <action android:name="android.service.wallpaper.WallpaperService" /> 24 </intent-filter> 25 26 <meta-data 27 android:name="android.service.wallpaper" 28 android:resource="@xml/wallpaper" /> 29 </service> 30 <receiver android:name=".Live2DReceiver"> 31 <intent-filter> 32 <action android:name="android.intent.action.SCREEN_ON"/> 33 <action android:name="android.intent.action.ACTION_CLOSE_SYSTEM_DIALOGS"/> 34 <action android:name="android.intent.action.ACTION_AIRPLANE_MODE_CHANGED"/> 35 </intent-filter> 36 </receiver> 37 </application> 38</manifest>
プロジェクトの構成は以下の通りです。
試したこと
この記事を参考に再起動したり、AndroidManifest.xmlのactionタグとcategoryタグを以下のように編集したりしましたが、同じエラーが出ました。
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
どうすればよいかご教示願います。
また後学のために、intent-filterのactionとcategoryに与えられている値はプロジェクトのどこと対応しているのだけでも教えていただけると幸いです。
質問修整
壁紙から起動できると教えていただいたので、エミュレータと実機の両方でやってみましたが、どちらもうまくいきませんでした。
エミュレータで起動
ホーム長押し->壁紙->Live2DWallpaperで、アプリケーションは見つけることができましたが、以下のようになり、2Dモデルが表示されませんでした。
エミュレータのログは以下の通りです。
前略 2022-02-22 22:23:15.371 26752-26752/com.live2d.demo D/AndroidRuntime: Shutting down VM 2022-02-22 22:23:15.372 26752-26752/com.live2d.demo E/AndroidRuntime: FATAL EXCEPTION: main Process: com.live2d.demo, PID: 26752 java.lang.UnsatisfiedLinkError: dlopen failed: library "libDemo.so" not found at java.lang.Runtime.loadLibrary0(Runtime.java:1087) at java.lang.Runtime.loadLibrary0(Runtime.java:1008) at java.lang.System.loadLibrary(System.java:1664) at com.live2d.demo.JniBridgeJava.<clinit>(JniBridgeJava.java:21) at com.live2d.demo.JniBridgeJava.SetContext(JniBridgeJava.java:55) at com.live2d.demo.LiveWallpaperService$Live2DWallpaperEngine.<init>(LiveWallpaperService.java:52) at com.live2d.demo.LiveWallpaperService.onCreateEngine(LiveWallpaperService.java:29) at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1469) at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 2022-02-22 22:23:17.224 26752-26768/com.live2d.demo W/System: A resource failed to call close.
実機をつないで起動
Android Studioで以下のエラーが出ました。スマホの壁紙一覧からアプリは見つけられませんでした。
-- Detecting CXX compile features - done -- Configuring incomplete, errors occurred! See also "C:/Users/{ユーザ名}/AndroidStudioProjects/CubismAndroidLiveWallpaper-master/AndroidWallPaper/app/.cxx/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log". CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it. CMake Error at CMakeLists.txt:31 (add_subdirectory): The source directory C:/Users/{ユーザ名}/AndroidStudioProjects/CubismAndroidLiveWallpaper-master/FrameWork does not contain a CMakeLists.txt file. CMake Error at CMakeLists.txt:33 (target_compile_definitions): Cannot specify compile definitions for target "Framework" which is not built by this project.
実機のエラーを受けて試したこと
違う場所にあったCMakeList.txtをコピペして実行してみたところ、以下のエラーが出ました。
前略(下と似たようなsame name * is already exists.のエラーが6個) CMake Error at CMakeLists.txt:36 (add_library): add_library cannot create target "Demo" because another target with the same name already exists. The existing target is a shared library created in source directory "C:/Users/{ユーザ名}/AndroidStudioProjects/CubismAndroidLiveWallpaper-master/FrameWork". See documentation for policy CMP0002 for more details. CMake Error at CMakeLists.txt:40 (target_link_libraries): Attempt to add link library "Framework" to target "Demo" which is not built in this directory. This is allowed only when policy CMP0079 is set to NEW.
【Cubism SDKのバージョン】CubismSdkForNative-4-r.4
【エミュレータ】Pixcel 2 API 30
【スマホ】Sony SOV34 (Xperia, Android 8.0)
【OS名・バージョン】Windows 10
【開発使用ツール】Android Studio Bumblebee | 2021.1.1
回答2件
あなたの回答
tips
プレビュー