0

I'm trying to follow the instructions here for integrating GameTextInput from the AGDK (Android Game Development Kit), but am having trouble with the CMakeLists part.

Adding this line as instructed:

find_package(game-text-input REQUIRED CONFIG)

Results in this error when the project syncs.

CMake Error at CMakeLists.txt:14 (find_package):
Could not find a package configuration file provided by "game-text-input"
with any of the following names:

There are no names printed. Above is the ONLY output.

I don't know what filename it's looking for, nor where it's looking. Do I need to manually install something or is it supposed to automatically work?

Gerry
  • 1,223
  • 9
  • 17
Bungles
  • 1,969
  • 2
  • 25
  • 54
  • "I don't know what filename it's looking for" - The format of searched names is actually described in [documentation for find_package command](https://cmake.org/cmake/help/latest/command/find_package.html). Since you are specifying CONFIG keyword, the searched files have format `-config.cmake` and `Config.cmake`. That results in files `game-text-input-config.cmake` and `game-text-inputConfig.cmake`. – Tsyvarev May 24 '22 at 00:21
  • Interesting. I wonder where that file is supposed to exist? Within the Android SDK? – Bungles May 24 '22 at 01:42
  • I am not aware about GameTextInput, but normally every CMake configuration file should come with the package **installation**. – Tsyvarev May 24 '22 at 08:53

1 Answers1

0

probably something is missed. Try with the steps in the instruction:

  1. enable prefab in your build
    *) in gradle.properties, ensure the followings are there:
     android.enableJetifier=true
     android.useAndroidX=true
     # optional: pick the latest prefab version at https://github.com/google/prefab/releases/
     android.prefabVersion=2.0.0
    
    *) enable prefab in you module gradle file(app/build.gradle)
      android {
          buildFeatures {
             prefab true
          }
          ...
      }
    
    • add the the latest game-text-input into the dependencies in the same app/build.gradle file:
          implementation "androidx.games:games-text-input:1.1.2-alpha01"
      
      
  2. C++ source code & static lib releases are packed inside the AAR's module include directory. Add them into your build system, for CMakeLists.txt:
        find_package(game-text-input REQUIRED CONFIG)
        target_link_libraries(${PROJECT_NAME}
            # other libs
            game-text-input::game-text-input
            android log)
    
  3. Do a build with Android Studio and it should go through. Then double check a couple of related places in terminal(you can map to windows' locations):
     cd $your-project-dir/app/.cxx
     find .  | grep game-text-inputConfig.cmake
     # open one of the found cmake config files to observe, no need to change
     cd ~/.gradle/caches
     find .  | grep game-text-input
     # go to the directory find out above, and observe the contents, might be in:
     # ~/.gradle/caches/transforms-3/3b2fce467ba34a9f9822795f41da04ae/transformed/jetified-games-text-input-1.1.2-alpha01/prefab
     # you can see the source file release and also the static lib release modules there.
    
  4. Follow the instructions to integrate C++ source files to your project.
Gerry
  • 1,223
  • 9
  • 17