Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7_0_X][TIMOB-25597] Android: Fixed bug where multidexed apps crash on startup on Android 4.x #9707

Merged
merged 5 commits into from Jan 24, 2018

Conversation

jquick-axway
Copy link
Contributor

…up on Android 4.x

- Fixed "_build.js" to create main dex class list if the min API Level is less than 21, not the target API Level.
  * Needed since Android 4.x does not support multidexed apps.
- Modified main dex class list to not include external module classes.
  * Significanlty reduces classes added to main dex list. Needed for anything using Google Play Services (adds too many APIs).
  * Modified app class template to init modules via reflection instead since module classes might not be in main dex file.
@jquick-axway jquick-axway added this to the 7.0.2 milestone Jan 8, 2018
@jquick-axway jquick-axway changed the title [TIMOB-25597] Android: Fixed bug where multidexed apps crash on startup on Android 4.x [7_0_X][TIMOB-25597] Android: Fixed bug where multidexed apps crash on startup on Android 4.x Jan 8, 2018
@build build added the android label Jan 9, 2018
@build
Copy link
Contributor

build commented Jan 9, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS

@lokeshchdhry
Copy link
Contributor

@jquick-axway , I get this error on all android versions wj=hen building with the fix.

[ERROR] Application Installer abnormal process termination. Process exit value was 1
[ERROR] :  Failed to run dexer:
[ERROR] :  
[ERROR] :  Error: Can't read [/Users/lchoudhary/Desktop/android-sdk-macosx/build-tools/27.0.3/lib/shrinkedAndroid.jar] (Can't process class [android/accessibilityservice/AccessibilityService.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))

Studio Ver: 5.0.0.201712081732
SDK Ver: 7.0.2 local build
OS Ver: 10.13.2
Xcode Ver: Xcode 9.2
Appc NPM: 4.2.11
Appc CLI: 7.0.1
Daemon Ver: 1.0.1
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.10
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 1.8.0_101
SDK Tools: 26.1.1
Platform Tools: 27.0.1
Build Tools: 27.0.3

- Added Android "gradle" build template.
  * Currently used to acquire/run newest ProGuard version. (Android SDK's ProGuard is old and doesn't support Java 8.)
  * Not used to build Android apps, yet.
- Added new "proguard.gradle" script.
  * Downloads/acquires newest ProGuard version via maven.
  * Can be used run ProGuard via gradle instead of via "java" command and the ProGuard JAR.
  * Accepts multiple ProGuard configuration files. (JAR version does not support this.)
- Fixed multidex ProGuard usage to work on Windows.
  * Was using a ':' colon as a file/path array separator instead of a ';' semicolon.
@jquick-axway
Copy link
Contributor Author

Updated PR.

@lokeshchdhry
Copy link
Contributor

@jquick-axway , Can you please fix the lint issues. Thanks.

@lokeshchdhry
Copy link
Contributor

FR Passed.

No crash seen after launch on android 4.X.

Studio Ver: 5.0.0.201712081732
SDK Ver: 7.0.2 local build
OS Ver: 10.13.2
Xcode Ver: Xcode 9.2
Appc NPM: 4.2.11
Appc CLI: 7.0.1
Daemon Ver: 1.0.1
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.10
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 1.8.0_101
Emulator: Android 4.4.2, Android 4.4.4

@ssjsamir
Copy link
Contributor

@jquick-axway Using the build from Mac-OS and then installing it to Windows (Like suggested earlier), the application crashed on a Android 4.4.4 Emulator (Application was able to run on the Android 6.0.0 emulator). Granted this may not be the best way to build on windows and the build it self said 7.1.0 although it was from this 7_0_X branch.

@jquick-axway
Copy link
Contributor Author

@ssjsamir, after doing the build on Windows, go to your project's ".\build\android" directory. Do you see files the files "proguard.gradle", "gradlew", and "gradlew.bat"? If not, then it sounds like you're not building with my PR's changes.

@ssjsamir
Copy link
Contributor

@jquick-axway Ah, I re-checked my build and noticed my Github desktop was interfering with my QE FR build tool and the wrong branch was getting checked out and then built. Once I addressed this issue I created the correct build from this PR and I was able to run the application on a Android 4.4.4 emulator on Windows (Sorry for any confusion). I Was also able to see files "proguard.gradle", "gradlew", and "gradlew.bat" in the ".\build\android" directory of my application.

@eric34 eric34 merged commit 2ac580d into tidev:7_0_X Jan 24, 2018
@build build added the android label Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants