Resolve BaseGameActivity

前端 未结 6 1010
不思量自难忘°
不思量自难忘° 2021-01-15 03:53

as many people I\'m trying to follow this tutorial without success. The simple error is:

The import com.google.example.games.basegameutils.BaseGameActivity c         


        
相关标签:
6条回答
  • 2021-01-15 04:29

    BaseGameActivity is not official from Google in order to use you need to copy its Source to your project. Please notice that the name of package declares its an "Example".

    0 讨论(0)
  • 2021-01-15 04:33

    The eclipse_compat folder is not directly available, it needs to be generated via a provided script. Refer to the section "If you're using Eclipse..." located on the main page of the "android-basic-samples" project.

    To summarize it:

    1. Download the android-basic-samples project from GitHub
    2. Unpack it and navigate to the "android-basic-samples-master" folder
    3. From this folder, run the command Scripts/make_eclipse_compat

    Once done, follow these steps in Eclipse:

    1. File -> Import -> Existing Android Code Into Workspace
    2. Navigate to the "android-basic-samples-master\eclipse_compat\libraries" folder and select the "BaseGameUtils" folder
    3. Optionally, select "Copy projects into workspace" and click Finish
    4. Right click on the imported project, select Properties -> Android and select the "is Library" option
    5. Within the same dialog, click the Add button to reference the "google-play-services_lib" project
    6. Click OK to confirm, the project should be ready to use
    7. Right click on your project -> Properties -> Android -> click the Add button to reference the imported project in your project
    0 讨论(0)
  • 2021-01-15 04:33

    You can have the eclipse_compat from current github. It is generated when you run a script that comes packaged (unzip the github file, then run Scripts/make_eclipse_compat).

    0 讨论(0)
  • 2021-01-15 04:35

    ozbek
    yes this worked,
    Yeah, I think I solved the issue. (Right click your project -> Properties -> Java Build Path -> Projects tab -> Add -> BaseGameUtils).

    0 讨论(0)
  • 2021-01-15 04:45

    You need to use BaseGameUtils located at eclipse_compat/libraries/BaseGameUtils instead of BasicSamples/libraries/BaseGameUtils. Since the eclipse_compat directory is no more available in the github site, I've shared it here.

    0 讨论(0)
  • 2021-01-15 04:46

    It appears my issue likely is that I am using Eclipse. I need to use the eclipse_compat folder and use a different BaseGameUtils. However on the github site where they host the code, they removed that folder.

    They suggest using Android Studio instead, I'm just not ready to migrate there yet. Does anyone have a copy of the BaseGameUtils for Eclipse?

    0 讨论(0)
提交回复
热议问题