When cocos2dx fix bug about create android project? (version 2.0.3)

cocos2dx-2.0.3 has problem that is creating android project.

When i create android project with ‘create-android-project.sh’ and build with ‘build_native.sh’,

All about it is ok.

But it has error with build apk. (<<I don’t know this expression is ok)

If i create android project on eclipse with New->Other->Android Project from Existing Code, imported project doesn’t have source in src/org.cocos2d.

I think this is bug because when i create android project on cocos2dx-2.0.2, this problem didn’t occur.

There isn’t people like me?

s.
I want fix this problem, but my programming skill is not enough…. T^T

All java codes are put into a separate project, so you should import sample codes and the engine’s java codes into eclipse.

@Minggo

Sorry. I didn’t know that.

Minggo Zhang wrote:

All java codes are put into a separate project, so you should import sample codes and the engine’s java codes into eclipse.

I’m trying to solve this also. I fixed it by copying the files like in 2.02. However, I don’t want to have to remember to do that for each new release now. I don’t quite understand what needs to be imported and where it should be imported in eclipse to get this to work. I imported the “sample” HelloCpp, but it has the same issue…

What exactly should I be importing? It seems that the goal was to just import the java files once for all projects in eclipse, but I don’t know how to do that… Would someone have a screenshot of eclipse showing where the files should be?

In Eclipse:

  1. Import Existent Android Code into Workspace

  2. Select source location from cocos2dx\platform\android\java

  3. You should now have a new project, probably will be called java. (You can refactor > rename to a better name).

  4. This new project was not compiling, had to comment out plenty of overrides, I think there was a cleaner solution in the past. Someone ?

    @Override
    public void onSensorChanged(final SensorEvent pSensorEvent) {
    (...)
    

to:

   //@Override
   public void onSensorChanged(final SensorEvent pSensorEvent) {
   (...)
  1. Now add this project as dependency to your project. Project properties > Java Build Path > Add

You should be able to run your project now.

Awesome! Thanks man, worked like a charm. I knew it was something like that.

As for the @Override issue, I fixed it by right-click Project~~>Properties~~>Java Compiler->Check “Enable project specific settings” and make sure the compiler compliance level is set to 1.6. Once I did that it stopped complaining about them.

Luis Mendes wrote:

In Eclipse:
>

  1. Import Existent Android Code into Workspace
  2. Select source location from cocos2dxplatformandroidjava
  3. You should now have a new project, probably will be called java. (You can refactor > rename to a better name).
  4. This new project was not compiling, had to comment out plenty of overrides, I think there was a cleaner solution in the past. Someone ?
    >
    […]
    >
    to:
    >
    […]
    >
  5. Now add this project as dependency to your project. Project properties > Java Build Path > Add
    >
    You should be able to run your project now.

How about change java compiler version?

I didn’t see same error.