[AC-5434] Android module auto upgrade of manifest causes module to fail loading and app to crash
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2017-12-10T21:09:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator CLI |
Labels | defect |
Reporter | Ophir Oren |
Assignee | Shak Hossain |
Created | 2017-12-10T20:08:59.000+0000 |
Updated | 2017-12-11T07:46:34.000+0000 |
Description
When running
appc run -p android --build-only -l trace
to compile an Android module written for versions earlier than SDK 7.0.0.GA, the CLI offers to upgrade the module. When choosing "yes" to upgrade the module the CLI updates the android module manifest file.
The CLI updates the manifest and setting minsdk: 7.0.0
. While compilation completes successfully, when the module is put in to an app it is causing the app to crash on load with an error message that the so
file of the module cannot be found:
couldn't find "libti.ga.so"; Titanium 7.0.0,2017/12/05 13:30,undefined
This is because the minsdk
is set to an incorrect version, and should be minsdk: 7.0.0.GA
.
When manually changing the version, cleaning build and libs folder and recompiling the error message goes away.
The libs/ directory and build/ directory cleanup was a general issue that could happen to builds when changing api-levels. TIMOB-25592 already takes care of this :).
@Hans - This is not the same bug. TIMOB-25592 is about the build directory while this one is about the minsdk version that is being wrotten by the CLI upgrade.
Please re-open
Thanks for updating the initial description, but this is not an issue. Many other working modules, even core-modules like [Ti.Map](https://github.com/appcelerator-modules/ti.map/blob/master/android/manifest#L19) use "7.0.0" and the app handles it fine. The error about the "so" files are because the libs directory does not get cleaned properly without flushing the directory before. In detail, this is handled by [this 10 lines](https://github.com/appcelerator/titanium_mobile/pull/9671/files#diff-e409a7861efa1e711ec49a7ff79beee7R415) that delete the directory, recreate it and pre-create the directories needed.