Comments (10)
懂了,谢谢dalao
from tucao.
翻了一下gradle console,找到以下报错:
Note: there were 11 duplicate class definitions.
e: 错误: Exception while handling step android.databinding.annotationprocessor.ProcessExpressions@2515ecd5 javax.xml.bind.UnmarshalException
e:
e: - with linked exception:
e: [com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。]
from tucao.
from tucao.
我在每个build.gradle文件都添加了task,依然报这个错。。
from tucao.
给dalao递茶,求dalao指导= =。
from tucao.
那篇博客给出的task方法我没有试过
但是根本解决方法是将所有含有中文的地方都用@string代替
例如
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='@{"共:" + viewModel.totalCount + "个相关结果"}'
android:textColor="@color/secondary_text"
android:textSize="12sp"
android:visibility="@{viewModel.totalCountVisibility}"
tools:text="共:274个相关结果" />
在values/strings.xml里加入如下字符串
<string name="gong">共</string>
<string name="jieguo">个相关结果</string>
然后上面的android:text
替换成
android:text='@{@string/gone + viewModel.totalCount + @string/jieguo}'
我不这么做的原因有以下几个:
- 工作量太大了,所有有中文的地方都要替换
- 我主要针对国内用户,不用做多语言支持
- 不优雅,破坏了Databinding直观的体验
- 我是Linux用户
from tucao.
我去试试, 拜谢dalao
from tucao.
@blackbbc 我试了下 不需要修改全部中文,databinding表达式中的中文改成@string就行了,
也不会太影响效果。项目就四五处需要修改。
例如:
android:text='@{"播放:"+viewModel.result.play}'
改成
android:text='@{@string/play+viewModel.result.play}'
from tucao.
Windows下添加一个环境变量JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
即可
@quert999
from tucao.
@DerekDick dalao给力
from tucao.
Related Issues (20)
- 问一下1.1.3下载视频需要什么系统模块。 HOT 2
- pull到1.5.1了后,运行报错,卸载原来的在运行还是报错。。。 HOT 3
- gsyVideoPlayer报错 HOT 2
- git clone --recursive -j8 https://github.com/blackbbc/Tucao.git出现问题 HOT 1
- MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。 HOT 1
- 视频源是不是都失效了 HOT 1
- 留言板拉到有图时闪退 HOT 2
- gsyVideoPlayer 没有运行不起来 HOT 1
- 为什么提示找不到.so文件呢? HOT 3
- 【在线等】不兼容的类型: NonExistentClass无法转换为Annotation HOT 1
- bug HOT 1
- 1.1.6的问题
- 1.1.7BUG
- 库不兼容,资源还找不到
- 华为荣耀
- 原本以为不更新了,结果发现是开发者没放打包编译
- 退回首页
- 播放每个视频都会从视频页面跳回到上一个界面
- 我试着编译了项目,但是有好多库过时了。编译比较困难 HOT 4
- 今天打开app发现因为域名更换导致app失效了,索性自己改了一下域名编译了以下,有需要的就给我发邮箱,看见了会回复的
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tucao.