Integrate an Android app (.apk) into an existing Android project

后端 未结 2 1970
眼角桃花
眼角桃花 2021-01-04 07:16

Here\'s the use case:

A friend and I are building an Android app and along with it want to integrate a game. The core of the app has been built in Eclipse but we ar

2条回答
  •  时光取名叫无心
    2021-01-04 08:02

    You may consider building dependency Project A as a JAR and include that JAR-file to the build path of your dependent Project B.

    To do that in Eclipse yo should click Export > Java > JAR > { Select project & unselect AndroidManifest.xml } > Finish

    If you do not exclude AndroidManifest.xml from your Project A, you will get an issue saying there are duplicating manifest files described here.

    Also you might get the following error:

    conversion to dalvik format failed with error 1

    To fix that just clean & rebuild your project

    I tried that for two projects having reference for the same version of Android SDK and it worked. Note that if you need to run activity from the Project A you also need to declare it in the manifest of the Project B

提交回复
热议问题