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 #3890 Break *Required into 2 parts. #4019

Merged
merged 13 commits into from
Dec 16, 2021
Merged

Fix #3890 Break *Required into 2 parts. #4019

merged 13 commits into from
Dec 16, 2021

Conversation

rishidyno
Copy link
Contributor

@rishidyno rishidyno commented Nov 30, 2021

Fix #3788

Explanation

LTR
Before After
Screenshot_20211214-184046 Screenshot_20211214-184048
Screenshot_20211214-184128 Screenshot_20211214-184188
Screenshot_20211214_133939 Screenshot_20211214_133939
Screenshot_20211214_133935 Screenshot_20211214_133955
RTL
Before After
Screenshot_20211214-173009 Screenshot_20211214-afterlpng
Screenshot_20211214-173024 Screenshot_20211214-173459
Screenshot_20211214_183328 Screenshot_20211214_183337
Screenshot_20211214_183338 Screenshot_20211214_183340

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

@rishidyno rishidyno changed the title Break *Required into 2 parts. Fix #3890 Break *Required into 2 parts. Nov 30, 2021
@rishidyno
Copy link
Contributor Author

rishidyno commented Dec 1, 2021

@BenHenning I am getting this error. I tried adding app_language_resource_handler dependency in the app BUILD.bazel file.

This is the error log

Starting local Bazel server and connecting to it...
INFO: Analyzed target //:oppia (280 packages loaded, 5615 targets configured).
INFO: Found 1 target...
ERROR: /home/rishi/opensource/oppia-android/app/BUILD.bazel:628:19: KotlinCompile //app:view_models_kt { kt: 156, java: 0, srcjars: 0 } for armeabi-v7a failed: (Exit 1): builder failed: error executing command bazel-out/host/bin/external/io_bazel_rules_kotlin/src/main/kotlin/builder '--flagfile=bazel-out/android-armeabi-v7a-fastbuild/bin/app/view_models_kt-kt-java.jar-0.params'
warning: runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk7.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk8.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.5.0/header_kotlin-stdlib-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.5.0/header_kotlin-stdlib-common-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.5.0/header_kotlin-reflect-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.10/header_kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.10/header_kotlin-stdlib-jdk7-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-script-runtime.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-reflect.jar (version 1.4)
warning: some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
warning: runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk7.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk8.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.5.0/header_kotlin-stdlib-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.5.0/header_kotlin-stdlib-common-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.5.0/header_kotlin-reflect-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.10/header_kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.10/header_kotlin-stdlib-jdk7-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-script-runtime.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-reflect.jar (version 1.4)
warning: some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
app/src/main/java/org/oppia/android/app/profile/AddProfileViewModel.kt:25:79: error: unresolved reference: add_profile_required
val starRequired: String = "" + resourceHandler.getStringInLocale(R.string.add_profile_required)
^
Compilation failure: compile phase failed:
warning: runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk7.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-stdlib-jdk8.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.5.0/header_kotlin-stdlib-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.5.0/header_kotlin-stdlib-common-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.5.0/header_kotlin-reflect-1.5.0.jar (version 1.5)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.10/header_kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/bazel-out/android-armeabi-v7a-fastbuild/bin/external/maven/v1/https/repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.10/header_kotlin-stdlib-jdk7-1.4.10.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-script-runtime.jar (version 1.4)
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/external/com_github_jetbrains_kotlin/lib/kotlin-reflect.jar (version 1.4)
warning: some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
/home/rishi/.cache/bazel/_bazel_rishi/2d9bbf034eeaafac68b4112f599a43d0/execroot/main/app/src/main/java/org/oppia/android/app/profile/AddProfileViewModel.kt:25:79: error: unresolved reference: add_profile_required
val starRequired: String = "
" + resourceHandler.getStringInLocale(R.string.add_profile_required)
^
Target //:oppia failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 33.654s, Critical Path: 23.36s
INFO: 3 processes: 2 internal, 1 linux-sandbox.
FAILED: Build did NOT complete successfully
rishi@r:~/opensource/oppia-android$

@BenHenning
Copy link
Sponsor Member

@rishidyno it looks like you addressed that problem by moving the view model to the VIEW_MODELS_WITH_RESOURCES list. However, you're also using a kotlinx import which shouldn't be used per https://developer.android.com/topic/libraries/view-binding/migration. You should use a direct resource reference, instead, and retrieve the view using findViewById.

@rishidyno
Copy link
Contributor Author

rishidyno commented Dec 10, 2021

@BenHenning @rt4914 All tests have passed PTAL.

@oppiabot oppiabot bot assigned BenHenning and unassigned rishidyno Dec 10, 2021
@oppiabot
Copy link

oppiabot bot commented Dec 10, 2021

Unassigning @rishidyno since a re-review was requested. @rishidyno, please make sure you have addressed all review comments. Thanks!

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @rishidyno! Took a full pass on the PR. Besides the comments I left in code, could you also please update your PR description to:

  1. Include an explanation for what this PR is doing, and some context on the approach you're taking
  2. To include a filled-in "For UI-specific PRs only" section (you should follow all the instructions list)
  3. Under the 'For UI-specific PRs only' please also include at least one screenshot with Arabic to demonstrate the RTL behavior for this string (I want to make sure it reverses correctly)

@BenHenning BenHenning assigned rishidyno and unassigned BenHenning Dec 14, 2021
@rishidyno
Copy link
Contributor Author

rishidyno commented Dec 14, 2021

@BenHenning I have added the SS and have addressed the changes PTAL.

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @rishidyno. This LGTM--nothing else to add!

@BenHenning
Copy link
Sponsor Member

I'm force merging this since @rt4914 is out & I'm more or less covering his codeowners this week. I reviewed the whole PR & everything LGTM, plus tests are passing.

@BenHenning BenHenning merged commit a285c0b into oppia:develop Dec 16, 2021
@rishidyno
Copy link
Contributor Author

Thanks @BenHenning

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.

Break AddProfileActivity string "*Required" into two parts.
2 participants