phrase / phrase-android Goto Github PK
View Code? Open in Web Editor NEWPhrase Over the Air Android SDK
Home Page: https://phrase.com
License: Other
Phrase Over the Air Android SDK
Home Page: https://phrase.com
License: Other
Phrase version: 3.0.6
Steps to reproduce:
A
, B
, C
and D
A
, B
, C
but not D
D
string resource is queried (using context.getString
) empty string is returnedExpected behavior
We are facing an issue with the SDK in our app, all of the views using inflated menus (for example: NavigationMenuView) and the preferences defined in XML (https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat.html#addPreferencesFromResource(int)) are not supported: the locale passed to setup is not respected, and translations are not updated via OTA.
It seems something went wrong in the build-pipeline, all logs on jitpack.io stating an error:
https://jitpack.io/#phrase/phraseapp-android
And no artifacts are accessible.
When using strings styled with HTML markup like Welcome to <b>Android</b>!
work fine until using OTA. Then the displayed text shows the HTML tags instead of being styled the usual way
this line this.setTextForView(view, resources.getString(attrs.getAttributeResourceValue(index, 0)))
in the TextViewTransformer
crashes with NoResourceFoundException when the resource isn't found because of the 0 int value
In order to make Lint checks work properly for default (without language folder suffix) resource xml, tools:locale
must be defined in resources xml tag:
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="cs">
It would be nice to be able to specify this this through .phrase.yml
or CLI argument.
Hey @theSoenke ,
While using the SDK version 3.x we saw that we miss some special characters for example the &
.
We have several keys in Phrase that are for example look like this Test & other test
. If we do receive those strings via OTA it gets broken with the new SDK and the retrieved string does not contain the &
anymore.
I was tracing it in Charles Proxy and it seems that the Phrase server responds correctly Test & other test
I could also verify this by downgrading again to 2.1.3 of the SDK and all worked fine again.
Could you please verify this on your side as well and provide some fix.
Once again the steps to reproduce it:
&
in Phrasecontext.getString()
) and verify that the &
is missingJust to mention I was also trying the latest SDK 3.0.3 and it also had the issue
Thank you!
I'm testing Phrase integration and my app has a BroadcastReceiver
registered in the manifest.xml like so:
<receiver android:name="com.redacted.AppUpdatedReceiver">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
And the class itself is a simple subclass of BroadcastReceiver
implementing onReceive
. If I comment this out of the manifest.xml everything works fine. When I have this enabled my app crashes soon after launch with:
java.lang.RuntimeException: Unable to instantiate receiver com.redacted.AppUpdatedReceiver: java.lang.ClassCastException: com.phrase.android.sdk.inject.PhraseContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4012)
at android.app.ActivityThread.access$1400(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassCastException: com.phrase.android.sdk.inject.PhraseContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3996)
at android.app.ActivityThread.access$1400(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Device: Google Pixel 5, Android 11
I'm using the latest material components version (1.4.0-rc01) and when accessing a screen which hosts the BottomNavigationView component in my app i receive this crash:
java.lang.NoSuchFieldError: No static field BottomNavigationView_menu of type I in class Lcom/google/android/material/R$styleable; or its superclasses (declaration of 'com.google.android.material.R$styleable' appears in /data/app/com.example.debug-Wmm5KDB8jGv2oazN9rPPWQ==/base.apk!classes17.dex)
at com.phrase.android.sdk.inject.ViewTransformer.a(SourceFile:14)
at com.phrase.android.sdk.inject.ViewTransformer.transformView(SourceFile:213)
at androidx.appcompat.app.PhraseAppCompatDelegate.createView(SourceFile:10)
at androidx.appcompat.app.PhraseAppCompatDelegate$factory2$1.onCreateView(SourceFile:1)
at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at androidx.fragment.app.Fragment.onCreateView(Fragment.java:1933)
I also see this issue on previous 1.3.0 version of the material library.
I'm on the latest version (3.0.5) of the phrase sdk, and can confirm that by removing it the issue is solved.
The Phrase SDK only returns strings from the default locale when updateTranslations
has not completed, even though setLocaleCode
has been called and local string resources for that locale exist.
Scenario:
The app contains English strings in values
and German strings in values-de
. The Phrase OTA distribution contains strings for both languages.
On app start, Parse is initialized, setLocaleCode("de-DE")
and updateTranslations()
are called. Before the update completes, we already display some UI.
Expectation:
While OTA translations are (still) unavailable, the Phrase SDK returns bundled string resources for the set locale (in this case German).
Reality:
While OTA translations are (still) unavailable, the Phrase SDK ignores the set locale and returns bundled string resources from the default locale (in this case English).
There is an error on the library where if user want to use Dark Mode with flag MODE_NIGHT_FOLLOW_SYSTEM.
MODE_NIGHT_NO, MODE_NIGHT_YES or MODE_NIGHT_AUTO_BATTERY works fine and only problem occurs due to the selection of MODE_NIGHT_FOLLOW_SYSTEM.
Once system dark mode is changed, the application did not restarted with proper dark mode theme in MODE_NIGHT_FOLLOW_SYSTEM selected.
The problem caused due to the Application class method overriding.
Causes Error:
override fun attachBaseContext(newBase: Context?) {
super.attachBaseContext(Phrase.wrapApplicationContext(newBase ?: this))
}
Hey there,
I'm reaching out to you because it turned out that the new SDK version 3.0.0 delivers internally some obfuscated classes which are not in the com.phrase.android.sdk
package. While compiling with another SDK we use (IDNow) we get a duplicate class error.
I think for a public SDK that should not be done in this way, we will also report the same Issue to IDNow since it is not a very good style of designing an SDK.
I hope you can help and please don't get me wrong obfuscation is totally fine :) But there should be a common package for those classes too.
Thanks for the help if you need further information please let me know.
Also here the compile error:
Duplicate class a.a.a.a.a found in modules jetified-android-sdk-3.0.0-runtime (com.github.phrase:android-sdk:3.0.0) and jetified-idnow-platform-3.20.1-runtime (de.idnow.android.sdk:idnow-platform:3.20.1)
Cheers
if we switch from Light To Dark mode we get our app to crash.
I think this is happening to all apps that implement this SDK
at androidx.appcompat.app.AppCompatDelegateImpl.applyDayNight(AppCompatDelegateImpl.java:2389)
at androidx.appcompat.app.AppCompatDelegateImpl.onConfigurationChanged(AppCompatDelegateImpl.java:666)
at androidx.appcompat.app.PhraseBaseAppCompatDelegate.onConfigurationChanged(SourceFile:1)
Android 12
Happens on Real devices as well as Emulator
Version Phrase SDK used 'com.github.phrase:android-sdk:3.1.2'
Thanks to OTA we can also do some dynamic mappings from keys not previously present in the build but that comes afterwards. For example, to map server error codes into proper user messages is very handy.
In iOS, when we do something like NSLocalizedString("my_server_error_key","")
we can get the message from OTA, even if it was not previously included in the build but added later.
However, in Android, I see no way to access it. I see there is a TranslationRepository
with a getString()
that would make the trick, but that repo is a private property of Phrase
. Could you expose a way to access it? maybe something like:
Phase.class
@Nullable
public static String getString(String key) {
return translationRepository.getString(key);
}
Is there any other way we can access the OTA keys dynamically (and not by a R.string
)?
Hello,
We integrated it into our Android app but Over the Air (OTA) doesn't work. I debug your code, download xml file and write to cache successfully. However, the layout on the screen are not updated.
How we can solve this problem ?
Hi, I am running into something similar to what I expressed in the iOS SDK some months ago regarding the behavior of min/max version constraints. Basically, this:
What I expected
Min/Max to be applied not only on downloading but also in future uses. So, if for example I am in app version 3.1.0, and there is an OTA for [3.0.0 - 3.2.0], then I expect OTA to download and use that file. However, when the user updates the app (without deleting) to 3.3.0, I was expecting the OTA to no longer apply and therefore serve strings from the app bundle rather than the outdated OTA file.
What I see happening
Min/Max is applied on download, so it only gets a new OTA file if the app version matches the range. However, once the OTA is downloaded, it seems to be used every time from now on, even if the app upgraded to a version that is no longer under the OTA range.
What is the problem?
The main issue I see with this behavior is that the translations are no longer consistent. So, if I update strings, users that downloaded some old OTA content are now seeing the old strings even if they have the app updated with newer texts, while new users downloading the app today see something newer (coming from the binary)
Can you confirm if the Android SDK is behaving this way on purpose? could you make an update like the one in iOS to make the versioning more consistent? otherwise, could it be possible to at least have a "clear cache" method or alike to reset the state after each app upgrade?
Thanks!
I want to see what your Android SDK does. Is this open source? If not then why put it here?
Using version 2.0.1 of the library, we noticed that the variable translationsChanged
of the callback's onSuccess
method is always false.
the name of the variable hints that it should be true when we get a new translations.
And I would like to suggest also to improve the callback by including the version number of the downloaded translation, this would be helpful for us to track the usage of feature.
In some cases, we fetch strings using application context. But it even though we've overriden attachBaseContext
method in our application It seems like it is not possible to reach your custom resources.
In #25 you mentioned that you will remove this path from the integration. And I see you have already removed it from your documentation.
Our team would appreciate it if you were able to find another way of exposing your PhraseResources
layer so we can still enable our usecase. Be it with via the singleton or somehow through the application context.
We were able to work around the issue by providing Phrase.wrapApplicationContext(application)
directly to the modules that require it. But this is of course unintended usage of the API and not ideal.
How to reproduce:
When force closing the app / swiping the app from the recent apps and relaunching the app the changed system locale is picked up
Locales in Phrase | Locales in Android, Locales found in requests
en | en_HK
ja | ja_JP
ko | ko_KR
zh-Hans | zh_CN_#Hans
zh-Hant | zh_HK_#Hant
When I try to request the translation xml
with the link containing the locale value zh_HK_#Hant
,
https://ota.phraseapp.com/DISTRIBUTION_ID/DEV_SECRET/zh_HK_#Hant/xml?
,
a 404 Not Found error is returned.
After checking with Phrase support
,
they found out the locale codes in the requests do not match the codes using in the project.
It seems Android added the location
to the locale code, i.e. _HK
in en_HK
.
For English
, Japanese
, Korean
, Phrase OTA can get the translation xml
correctly even the location is included in the locale code,
i.e. Phrase OTA can handle to redirection from the url
with en_HK
, ja_JP
, ko_KR
to translation xml
for English
, Japanese
, Korean
.
It ONLY failed for Simplified Chinese and Traditional Chinese.
Then I have called the Phrase.setLocaleCode
to update the locale to zh-Hans
/ zh-Hant
,
enforcing Phrase OTA
to get the correct translation xml
for Simplified Chinese / Traditional Chinese.
However, I found that after calling Phease.setLocaleCode
with zh-Hans
/ zh-Hant
,
some UI components cannot be completely translated,
see the Day of Week
row, Cancel
/ OK
buttons for DatePicker
,
which they should be displayed in Chinese
instead of English
.
In short, I have to set the locale with Phrase.setLocaleCode("zh-Hant") to fetch the translation xml.
However, Phrase.setLocaleCode(“zh-Hant”)
may change the locale settings in Android context
which broke the localization in DatePicker.
I am using Phrase OTA version 3.1.3
.
I have tried to launch the app in Android Emulator
with Android 6 & 7
.
I found the TextView
keeps displaying the old
translations,
NOT the translation updated with OTA
.
Is the Phrase OTA 3.1.X compatible with Android 6 & 7
?
We have several texts using html to be able to add bold and some other minor style changes into a styled text.
We were able to use them with no problems up until we upgraded phraseapp sdk from 2.1.3 to 3.0.5 (we are not using 3.0.6 due to some androidx incompatibility in the bottom navigation that we need to solve first). However, with the newer version, every time we try to get the string it returns it without any HTML tag. So:
This code:
getString(R.string.social_feed_post_match_user_title, name, tenant)
with this text value (in the local resources) :
<string name="social_feed_post_match_user_title"><![CDATA[<b>%1$s</b> shared a result in <b>%2$s</b>]]</string>
Returns:
{name} shared a result in {tenant}
If we disable OTA altogether (removing the delegate, the application context wrapper and the Phrase.setup
) then the code returns the expected string:
<b>{name}</b> shared a result in <b>{tenant}</b>
This feature is crucial for us, and a blocker to update the library
our project uses iOS placeholders by default and we use convert_placeholder
in our android yml file
which causes the SDK to crash when it retrieves the strings
same for enclose_in_cdata
We use Phase in our project.
Currently we are implementing in-app language change (https://developer.android.com/guide/topics/resources/app-languages) which is officially supported in Appcompat 1.6.0-rc01 or 1.7.0-alpha01.
This works fine with sdk < 33, but on Tiramisu AppCompatDelegate.getApplicationLocales() doesn't return locale code.
To fix it I added a workaround:
` override fun getDelegate(): AppCompatDelegate {
return if (Build.VERSION.SDK_INT >= TIRAMISU) {
super.getDelegate()
} else {
Phrase.getDelegate(this, super.getDelegate())
}
}`
Can You add support to in-app language change using Appcompat so we can remove this hack?
Hello,
App crashes when clicked on “copy” option selected text in android webview on many devices. There was no such problem before 2.1.3 release.
Best,
Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x2090005
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:237)
at android.content.res.Resources.getInteger(Resources.java:1115)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.a(PG:207)
at yY.onCreateActionMode(PG:15)
at KW.onCreateActionMode(PG:6)
at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onCreateActionMode(DecorView.java:2595)
at com.android.internal.policy.DecorView.startActionMode(DecorView.java:913)
at com.android.internal.policy.DecorView.startActionModeForChild(DecorView.java:869)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:1008)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:1008)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:1008)
at android.view.View.startActionMode(View.java:7324)
at HL.a(PG:1)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.h(PG:137)
at LU.a(PG:31)
at Lv.a(PG:14)
at EI.run(:6)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Hello, I've encountered following issue when using phraseapp OTA library for my project.
Sometimes gradle is unable to download aar for the dependency (it returns 401 Unauthorized) if I also use another private jitpack library in the project.
When I use phraseapp lib alone it works perfect and always download the dependency during gradle sync.
I created an issue on jitpack's repo with detailed description (jitpack/jitpack.io#3759) , but I'm not sure if the problem is on their side. Maybe you can take a look on it?
In Compose-only apps there is no need for AppCompatActivity
and it would be very good to support usage in ComponentActivity
without need to add AppCompat dependency
I found this error from this url : https://ota.phraseapp.com/07b000138453eb557719a90b4921499c/ZqIHaY2tJeuaMftKoIebva02Bk9E-Ld-_hxW_AlLYgU/en_US/xml?client=android&unique_identifier=2fecf1ba-b044-4f71-9e39-04fa172400d7&sdk_version=3.2.2&app_version=1.0
I think it because the value of app_version parameter is not valid. If I change it to app_version=1.0.0, it's worked.
Do you have any solution for me to fix it ?
We want to add this annotation to a key to ignore it from our lint.yml
e.g.
<!--suppress PluralsCandidate -->
<string name="my_key">%1$d Cats</string>
If we add it manually phraseapp pull
will overwrite it. Is there a way to support annotations like this?
Is there a nice way to implement Phrase OTA - without creating a BaseActivity? We want to move away from a Base activity and therefor Inherintance but instead use composition?
I looked around but doing this for the attachBaseContext
method isn't easy. Is there a way?
I'm talking about these instructions: https://help.phrase.com/help/android-sdk-installation-instructions
In my current App I'm already wrapping my context
with a ContextWrapper
when using Phrase SDK
with its Phrase.wrap()
it seems that it doesn't work.
If I use it as follows:
@Override
public void attachBaseContext(Context newBase) {
super.attachBaseContext(Phrase.wrap(LocaliseContextWrapper.wrap(newBase, getLocale())));
}
Then Phrase SDK is working and I'm getting the new Strings. But LocaliseContextWrapper
isn't working anymore.
If I use it as follows:
@Override
public void attachBaseContext(Context newBase) {
super.attachBaseContext(LocaliseContextWrapper.wrap(Phrase.wrap(newBase), getLocale()));
}
Then I get the same result.
FYI, this is LocaliseContextWrapper
internals
class LocaliseContextWrapper(base: Context?) : ContextWrapper(base) {
companion object {
@JvmStatic
fun wrap(context: Context, newLocale: Locale?): ContextWrapper {
val config = Configuration()
config.setLocale(newLocale)
return ContextWrapper(context.createConfigurationContext(config))
}
}
}
Not too weird or something. How can I combine both wrappers? I need them both!
Sidenote:
I'm using AppCompat version 1.2.0
Phrase version 3.0.5, AppCompat version 1.3.0.
Steps to reproduce:
minifyEnabled true
to workaround this i've found in my tests that we can:
minifyEnable false
Phrase.getDelegate(this, super.getDelegate())
line in my codeAlso, this issue has been found in our live app in multiple phones and android versions.
EDIT- also, i've used app bundles, i don't know if that is meaningful or not
Hey, we noticed an issue with the SDK, some messages seems to be surrounded with double quotes on the app.
When investigating we found that all those messages have some trailing white spaces, when we pull those message through the cli, we noticed the double quotes, this doesn't cause any issue when we don't use the SDK, as Android ignores the quotes.
But when these messages gets pulled through OTA, the quotes are displayed on the UI, and we confirmed this by putting a breakpoint in the method CustomResources.getText(id)
We are facing an issue with all formatted strings when using the OTA SDK, they appear as
after updating the SDK to 2.0.0 (before they appeared as \n).
The workaround we are using now is passing the retuned string to Html.fromHtml(), but it's not a pretty solution!
Hello. We tried to use "Over the air" integration in our app, but we faced unexpected crashes among our users.
Such crash happens when the user select some text in the WebViews we have for some of our features, as there is a resource not resolved that would seem to be needed in ordre to display the contextual menu for this text selection (copy, etc)
I link the stack trace here:
android.content.res.Resources$NotFoundException: Resource ID #0x20c0062
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:216)
at android.content.res.Resources.getInteger(Resources.java:1106)
at org.chromium.ui.base.DeviceFormFactor.b(chromium-Monochrome.aab-stable-541411823:22)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.z(chromium-Monochrome.aab-stable-541411823:3)
at bv.onCreateActionMode(chromium-Monochrome.aab-stable-541411823:28)
at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onCreateActionMode(DecorView.java:2412)
at com.android.internal.policy.DecorView.startActionMode(DecorView.java:888)
at com.android.internal.policy.DecorView.startActionModeForChild(DecorView.java:844)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.View.startActionMode(View.java:6875)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.E(chromium-Monochrome.aab-stable-541411823:75)
at J23.a(chromium-Monochrome.aab-stable-541411823:38)
at Cd3.k(chromium-Monochrome.aab-stable-541411823:7)
at uo.run(chromium-Monochrome.aab-stable-541411823:15)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
This crash seems to be induced by the AppCompatDelegate setup required by the integration guide:
abstract class BaseActivity: AppCompatActivity {
override fun getDelegate(): AppCompatDelegate =
Phrase.getDelegate(this, super.getDelegate())
}
We used one of the latest version of Phrase SDK (3.2.1).
Is it something you are aware of? Is it something linked to the version of AppCompat library Phrase sdk is using?
Can you please provide some insights on this? Thanks
Hi, I get this exception when I tried to use Phrase OTA in my new basic Android project using our existing distribution id & environment.
The sample app that I tried is basically a carbon copy of sdk sample usage in here.
This is the only message/error that appeared on logcat.
D/Phrase OTA: org.xmlpull.v1.XmlPullParserException: expected: /b read: string (position:END_TAG </string>@264:77 in java.io.InputStreamReader@ed564b1).
The detail on translated text that I'm using is:
STRING_CLOSE
Close
More details:
Kindly help explain what is going on here.
It will be helpful if Phrase add support to get string for multiple locale for the same time. Like the following code
Phrase.getString(key, locale)
In my case, there are background tasks to generate report (pdf) in multiple language. If I set Phrase.setLocaleCode(locale)
before the task then user will see the UI in different language.
Phrase is hosted on https://jitpack.io, and they had a lot of issues lately with keeping their services running. https://github.com/jitpack/jitpack.io/issues?q=is%3Aissue+broken. With Jitpack down, we're unable to create a build that depends on Phrase.
Can a Phrase SDK for Android get a different host provider?
Hello,
After updating Phrase OTA SDK from 2.x to 3.0.x we noticed an issue during translations update which always fails. Looking at stack trace in debugger I noticed an XmlPullParserException , I don't know how to get more informations about that exception, I checked the translation files for maybe some weird characters and tried to remove it on a new OTA release, nothing changed
On 2.x version updates were working fine but we were having issues with realtime updates, that's why we decided to try version 3.X
Error(e=org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT
delete use...@130:5 in java.io.InputStreamReader@a03213b) )
I've read that appcompat may have impact on library proper working, we were using 1.2.0, tried to bump until 1.3.1, same behaviour
Other gradle settings
compileSdkVersion 30
...
buildToolsVersion '30.0.3'
minSdkVersion 24
targetSdkVersion 30
..
compileOptions
{
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
Let me know if you need more information ! Thanks.
Thanks for fixing #7 - I unfortunately encountered a similar issue now:
Escaped special characters like \n
are not properly handled after an OTA update and show as \n
instead of causing a line break
Hi,
I made some changes to my app today and noticed that once I introduced androids new view-binding that the translations are not changed. Reverting the project back to the original synthetic way returns true.
It would seem like the SDK doesn't support the new way of view binding and if so when will it be supported?
I'm using version 3.0.5
The app is written in Kotlin.
You could most likely easily reproduce this by setting up a new project and following the guide provided above but if you need anything else please let me know
@theSoenke Thanks for the 2.0.0 update, it seems like the HTML tags issue has been fixed
we are now experiencing a different issue with escaped strings
can OTA support multiple environment?
An application that uses the Phrase android SDK becomes blinking after changing a battery saver.
Repro steps:
localeCode
: "en" or "en_gb":Phrase.setup(this, "DISTRIBUTION_ID", "ENVIRONMENT_TOKEN", "en");
Current behavior: The app is blinking and a user cannot interact with it.
Expected behavior: The app shouldn't blink, it should successfully handle batter saver change.
I would like to mention that the app doesn't become blinking after the battery saver change if we don't pass the localeCode
.
Video example:
https://user-images.githubusercontent.com/33689229/219599223-53ea246c-86e5-4a44-8ead-973e895fcdf3.mov
Tested on:
Hello,
The Google Play Store console is reporting us a lot ANRs (around one million each month) that seems to be due to Android Phrase SDK. I've already reported this to your technical support but never got any answer.
Each ANR happen when a broadcast is received or when a service is started by the app, so it's possible the issue is only there in background. The stacktrace of each report is always the same and look like that :
at sun.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:450)
at java.util.concurrent.FutureTask.get (FutureTask.java:192)
at com.phrase.android.sdk.RepositoryHolder.getRepository (RepositoryHolder.java:1)
at com.phrase.android.sdk.inject.PhraseResources.b (SourceFile:3)
at com.phrase.android.sdk.inject.PhraseResources.getText (SourceFile:1)
at com.phrase.android.sdk.inject.PhraseResources.getString (SourceFile:1)
at android.content.Context.getString (Context.java:649)
ANRs have an impact on our app quality and Play Store app ranking, that's why we want to get rid of them ASAP. Could you please look at it and let me know how to fix it?
Thanks
Hello. We use "Over the air" integration in our app and we faced issue with applying strings in xml. We use in our xml file something like this.
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
style="@style/TabLayoutWallet"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text1" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text2" />
</com.google.android.material.tabs.TabLayout>
Tab items not load locales and its show only value that stored locally in strings.xml only. Also we faced with this issue when we use helperText in com.google.android.material.textfield.TextInputLayout widget. As a workaround we set a value of this type of views by code but it's so annoying. Please provide any help.
We get weird exceptions when using Phrase SDK and android.app.TimePickerDialog
widget.
Only reproduced it on Android 9 and 8 for now. 10 and above works as expected.
It seems to be caused by an older version of the ViewPump library. There is an identical issue in this github project.
Additionally, I wasn't able to test with 3.0.4 because something is broken with it on jitpack.io
android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class Button
Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class Button
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.Button" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/our.package-7ocexMTXPn9pTVBEZu4IXQ==/base.apk"],nativeLibraryDirectories=[/data/app/our.package-7ocexMTXPn9pTVBEZu4IXQ==/lib/x86_64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:703)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.ViewStub.inflateViewNoAdd(ViewStub.java:269)
at android.view.ViewStub.inflate(ViewStub.java:302)
at com.android.internal.app.AlertController.resolvePanel(AlertController.java:506)
at com.android.internal.app.AlertController.setupView(AlertController.java:530)
at com.android.internal.app.AlertController.installContent(AlertController.java:264)
at android.app.AlertDialog.onCreate(AlertDialog.java:436)
at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
at android.app.Dialog.show(Dialog.java:302)
at android.app.TimePickerDialog.show(TimePickerDialog.java:149)
at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:688)
at androidx.fragment.app.Fragment.performStart(Fragment.java:3008)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:586)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:300)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2177)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2088)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1990)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Hi, we are facing an issue with the integration, which has lead to some crashes in Production, we noticed that the Min Version field is not respected, and that distributions are available to older versions as well.
While investigating we noticed this:
And despite having an older version, the SDK got a 200OK response, with the releaseVersion 25, below a screenshot of the debugging session parameters:
This is urgent, as it's stopping us from using the SDK in production.
Phrase version 3.0.6
Using Kotlin and RIBs to build the app
After changing language using Phrase.setLocaleCode(localeCode) and Phrase.updateTranslations(), some string didn't update their language into the new one.
For those un-updated strings were declared by the xml andreoid:text
attribution but it can be updated once set the text programmatically.
Can anyone help?
Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.