Reputation: 1
import com.google.example.games.basegameutils.GameHelper;
public class MyAppName extends Cocos2dxActivity implements GameHelper.GameHelperListener {
....
.....
public static GameHelper gameHelper;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
gameHelper = new GameHelper(this);
.....
error point: gameHelper = new GameHelper(this);
error Message : Could not find class 'com.google.example.games.basegameutils.GameHelper', referenced from method com.company.MyAppName.MyAppName.onCreate
How do I fix this?
Upvotes: 0
Views: 3471
Reputation: 1745
In the latest BaseGameUtils project (I downloaded from google github on Aug 13, 2014), the source files are not under the src/ folder. so you will need to Properties->Java Build Path->Add folder and select the java folders.
If the project then compiles without error for the BaseGameUtils, great! I also encountered some other compilation errors and solved it by update the Google Play services to the latest version in SDK manager.
Hope it helps.
Upvotes: 0
Reputation: 5076
On BaseGameUtils, go to Project Properties | Android. Verify that it's targeting a valid Android target that's present on your SDK (anything with API level >= 8 should work).
Also on the project properties screen for BaseGameUtils, check that the "Is Library" checkbox is checked.
Check that BaseGameUtil is referencing google-play-services_lib as a library. (Project Properties | Android | References).
Check that your project is referencing BaseGameUtil as a library (same).
Hope this helps!
Upvotes: 2
Reputation: 3489
Did you define Basegameutils as a library project and include it as a reference ?
The doc that accompanies the sample is fairly good.
Upvotes: 0