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

Fix #3803: Bazel/Gradle Support on Kitkat [BLOCKED on #3804] #3740

Closed
wants to merge 10 commits into from

Conversation

anandwana001
Copy link
Contributor

@anandwana001 anandwana001 commented Aug 26, 2021

Explanation

Fix #3803

APK supports on Kitkat when built using Gradle.

APK is building using Bazel, but crash when run on Kitkat version with the following errors:

  1. Not able to bind the vector tag on the splash screen
  2. Unable to start service androidx.work.impl.background.systemalarm.SystemAlarmService@9d1ab7c0

The permission issue can be solved using adding permission to manifest
, but need to figure out the exact reason why KitKat needs this permission.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@BenHenning
Copy link
Member

@anandwana001 this isn't introducing bundle support yet since it isn't using android_application--can you try out that target first to see if it works before separating out data module?

@BenHenning BenHenning assigned BenHenning and unassigned BenHenning Aug 26, 2021
@BenHenning
Copy link
Member

@anandwana001 now that #3750 exists please update this to be branched off of that & update the approach to change the flavors defined in build_flavors.bzl, instead.

@BenHenning BenHenning removed their assignment Sep 1, 2021
@anandwana001 anandwana001 changed the title [SAMPLE] Add Android app bundle support with Bazel Add Android app bundle support with Bazel [BLOCKED on 3750] Sep 6, 2021
@anandwana001
Copy link
Contributor Author

The current implementation in this PR works when built and install using gradle.

Getting following error with Bazel.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.oppia.android, PID: 4098
    java.lang.RuntimeException: Unable to instantiate application org.oppia.android.app.application.OppiaApplication: java.lang.ClassNotFoundException: Didn't find class "org.oppia.android.app.application.OppiaApplication" on path: DexPathList[[zip file "/data/app/org.oppia.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.oppia.android-1, /vendor/lib, /system/lib]]
        at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4317)
        at android.app.ActivityThread.access$1500(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.oppia.android.app.application.OppiaApplication" on path: DexPathList[[zip file "/data/app/org.oppia.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.oppia.android-1, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
        at android.app.Instrumentation.newApplication(Instrumentation.java:975)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4317) 
        at android.app.ActivityThread.access$1500(ActivityThread.java:135) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:136) 
        at android.app.ActivityThread.main(ActivityThread.java:5017) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:515) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
        at dalvik.system.NativeStart.main(Native Method) 

@anandwana001 anandwana001 marked this pull request as ready for review September 13, 2021 05:22
@BenHenning
Copy link
Member

@anandwana001 do we have an issue tracking the latest KitKat issue (the SVG issue)?

Also, can you please update the PR title & description to more correctly describe what this PR is actually doing? We now have AAB support checked in, so the current title is no longer correct.

@BenHenning BenHenning removed their assignment Sep 16, 2021
@anandwana001 anandwana001 changed the title Add Android app bundle support with Bazel [BLOCKED on 3750] Bazel/Gradle Support on Kitkat Sep 16, 2021
@anandwana001 anandwana001 changed the title Bazel/Gradle Support on Kitkat Fix #3803: Bazel/Gradle Support on Kitkat Sep 16, 2021
@oppiabot
Copy link

oppiabot bot commented Sep 23, 2021

Hi @anandwana001, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 3 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 23, 2021
@anandwana001 anandwana001 changed the title Fix #3803: Bazel/Gradle Support on Kitkat Fix #3803: Bazel/Gradle Support on Kitkat [BLOCKED on #3804] Sep 28, 2021
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 28, 2021
@oppiabot
Copy link

oppiabot bot commented Oct 5, 2021

Hi @anandwana001, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 3 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 5, 2021
@rt4914 rt4914 removed their assignment Oct 5, 2021
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 5, 2021
@anandwana001
Copy link
Contributor Author

closing this as this is handled in other pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bazel/Gradle Support on Kitkat
4 participants