Adding the Eclipse Android Library Project and Creating Through Maven

I am trying to incorporate cocos2d into a preexisting application. I did something like Eclipse, for example, installed "isLibrary" and added the library project to the build path in Eclipse, and I have the following dependency in my application pom.xml:

<dependency>
    <groupId>cocos2d_android</groupId>
    <artifactId>cocos2d_android</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

I thought this would take care of this problem, but when I build, the library does not seem to be included. I know this because when I start Activity, SimpleGamereferring to one of the classes in the cocos2d source, the activity dies and I get this stack in DDMS:

E/AndroidRuntime(10621): FATAL EXCEPTION: main E/AndroidRuntime(10621): java.lang.NoClassDefFoundError: org.cocos2d.opengl.CCGLSurfaceView E/AndroidRuntime(10621): at com.xyz.game.SimpleGame.onCreate(SimpleGame.java:22) ...

I am looking for two things:

1) a reliable way to see if a certain class / jar / was everything that was packed into my apk, since the steps for this moment in my application are long and complicated now

2) - pom.xml - - , Maven , - ?

Maven 3.0.4 3.0.0-alpha-13 , 8 .

+5
2

1) , /jar/, apk, , ,

(.. mvn clean install), maven / , dex - :

[INFO] --- android-maven-plugin: 3.1.1: dex (default-dex) @myproject ---
[INFO] C:\Program Files\Java\jdk1.6.0_21\jre\bin\java [-Xmx1024M, -jar, C:\Progr am Files\Android\android-sdk-r16\platform-tools\lib\dx.jar, --dex, --output = C:\workspace\myproject\target\classes.dex, C:\workspace\myproject\target\classes, C:\maven\repository\cocos2d_android\cocos2d_android\1.0.0-SNAPSHOT\cocos2d_android-1.0.0-SNAPSHOT.apklib, C:\maven\repository\com\google\code\gson\gson\1.7.1\gson-1.7.1.jar,......]

Android cocos2d_android-1.0.0-SNAPSHOT.apklib .


2) - pom.xml , , - - , Maven , - ?

ApkLib, zip- Android Library (src/, res/, AndroidManifest.xml ..). / Android Android maven, , Android, . -maven- Android, Maven, Android Maven:

.apklib Android/Eclipse. , Maven, .apklib , "src/" "src/main/java/", Android/Maven . , Maven, Android.

, Maven

, zip Android ( , Maven), mvn install: install-file... .

.apklib Maven

.apklib , Maven, , , , .zip. .

, :

  • Android zip-, something.apklib.
  • something.apklib Maven, mvn install: install-file.
  • Android-, , :

    <dependency>
      <groupId>cocos2d_android</groupId>
      <artifactId>cocos2d_android</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <type>apklib</type>
    </dependency>
    

Samples - Android-maven, , apklib.

+4

provided. :

- , , JDK . test, .

compile .

: compile , <scope>provided</scope>.

+1

All Articles