📜 ⬆️ ⬇️

Unpleasant Eclipse Surprise

image
In some cases, Eclipse adds source code from the jni directory to apk.

Extremely unpleasant reason to write this note.
I think everyone imagines what the issue of publishing an apk containing its own source code can be.
It was discovered quite by accident.
In the process of developing apk of our project weighed 19 megabytes.
Before the release, we rethought the project management and made several changes to the directory structure.
In particular, they transferred source codes from jni to an external directory.
And suddenly, during the assembly, the project lost up to 13 megabytes. At the same time fully maintaining performance.
This change in project behavior cannot be ignored. And we began to dig - what has changed.
What was our surprise when unpacking apk of previous versions (yes, we store all the signed assemblies) it turned out that they contain all the contents of the jni directory! Those 6 megabytes.
When we moved the source code to a level above the project, they left the collector’s area of ​​responsibility and stopped adding to apk.
At the moment, we have not yet figured out why Eclipse adds jni to the package when building it, but we already consider it important to communicate this opportunity to the community.

I am extremely pleased that we discovered this situation before the full publication and the beginning of promotion.
It is terrible to imagine what you can run into by publishing your own source code. But it is even more terrible to publish the source codes of closed licensed libraries.

UPD:
In fairness, so as not to give another reason to curse Eclipse:
Eclipse in this text is worth reading as ADT. After all, it is not the Eclipse package itself that assembles, but ADT.

')

Source: https://habr.com/ru/post/217011/


All Articles