Android Studioでサンプルアプリを実行しても起動しない

以下の2021年夏のLive2Dワークショップの記事を参考に、サンプルアプリのWallPaperを起動しようとしています。

エミュレータと実機の両方でやってみましたが、どちらもうまくいきませんでした。どうすればよいかご教示お願いします。

エミュレータで起動

ホーム長押し->壁紙->Live2DWallpaperで、アプリケーションは見つけることができましたが、以下のようになり、2Dモデルが表示されませんでした。


なお、以下のエラーが出ています。

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

エミュレータのログは以下の通りです

前略
2022-02-22 22:23:[15.371 26752-26752](tel:153712675226752)/com.live2d.demo D/AndroidRuntime: Shutting down VM
2022-02-22 22:23:[15.372 26752-26752](tel:153722675226752)/com.live2d.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.live2d.demo, PID: 26752
java.lang.UnsatisfiedLinkError: dlopen failed: library "[libDemo.so](http://libDemo.so)" not found
at java.lang.Runtime.loadLibrary0([Runtime.java:1087](http://Runtime.java:1087))
at java.lang.Runtime.loadLibrary0([Runtime.java:1008](http://Runtime.java:1008))
at java.lang.System.loadLibrary([System.java:1664](http://System.java:1664))
at com.live2d.demo.JniBridgeJava.<clinit>([JniBridgeJava.java:21](http://JniBridgeJava.java:21))
at com.live2d.demo.JniBridgeJava.SetContext([JniBridgeJava.java:55](http://JniBridgeJava.java:55))
at com.live2d.demo.LiveWallpaperService$Live2DWallpaperEngine.<init>([LiveWallpaperService.java:52](http://LiveWallpaperService.java:52))
at com.live2d.demo.LiveWallpaperService.onCreateEngine([LiveWallpaperService.java:29](http://LiveWallpaperService.java:29))
at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage([WallpaperService.java:1469](http://WallpaperService.java:1469))
at [com.android](http://com.android).internal.os.HandlerCaller$MyHandler.handleMessage([HandlerCaller.java:44](http://HandlerCaller.java:44))
at android.os.Handler.dispatchMessage([Handler.java:106](http://Handler.java:106))
at android.os.Looper.loop([Looper.java:223](http://Looper.java:223))
at [android.app](http://android.app).ActivityThread.main([ActivityThread.java:7656](http://ActivityThread.java:7656))
at java.lang.reflect.Method.invoke(Native Method)
at [com.android](http://com.android).internal.os.RuntimeInit$[MethodAndArgsCaller.run](http://MethodAndArgsCaller.run)([RuntimeInit.java:592](http://RuntimeInit.java:592))
at [com.android](http://com.android).internal.os.ZygoteInit.main([ZygoteInit.java:947](http://ZygoteInit.java:947))
2022-02-22 22:23:[17.224 26752-26768](tel:172242675226768)/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

toro_灯篭 さん
いつも弊社製品をご愛顧くださり誠にありがとうございます。
また、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

上記のエラーについては、当日資料の20ページに記載されているLaunch Option設定の変更をお試しください。

CMake Error at CMakeLists.txt:33 (target_compile_definitions): Cannot specify compile definitions for target “Framework” which is not built by this project.

上記のエラーについては、FrameWorkフォルダの中が空になっていないかご確認ください。

もし空になっている場合は、以下のページからFrameWorkフォルダの中身をダウンロードし、プロジェクトのFrameWorkフォルダにコピー&ペーストを行なってください。

こちらはgithubの仕様によるもので、プロジェクトをzipでダウンロードした際にサブモジュールが空になってしまうことが原因となります。

説明が不足しており、申し訳ございません。

違う場所にあったCMakeList.txtをコピペして実行してみたところ

こちらについては元のCmakeList.txtを使用してください。

以上、上記3点をご確認いただきますようお願いいたします。

「いいね!」 1

ありがとうございます!
Launch OptiionをNothingに設定し、FrameWorkフォルダにファイルをインストールしたところ、問題なく壁紙として設定できました。

「いいね!」 1