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

修改了 xml 资源后不生效 #85

Open
VankaIn opened this issue Dec 19, 2017 · 3 comments
Open

修改了 xml 资源后不生效 #85

VankaIn opened this issue Dec 19, 2017 · 3 comments

Comments

@VankaIn
Copy link

VankaIn commented Dec 19, 2017

修改了布局文件textview 的 text 属性(其他属性也会)
会提示:

Source and reource not changed

然后 activity 也没有 restart

@VankaIn
Copy link
Author

VankaIn commented Dec 19, 2017

还有一个现象就是:
修改 layoutA.xml 不生效的情况下,修改 layoutB.xml 生效了,那么上一次的 layoutA.xml 的修改也生效

@typ0520
Copy link
Owner

typ0520 commented Dec 19, 2017

判断资源是否发生变化是根据是否执行了processResources任务,出现这种情况时留意下日志里processResources后面有没有UP-TO-DATE,如果没有就是fastdex的问题了方便的话提供一个完整的打包日志

@VankaIn
Copy link
Author

VankaIn commented Dec 19, 2017

成功的日志:

> Task :app:fastdexScanAptOutputForDebug
==fastdex diff apt dir: /Users/liangjunjie/Android/workspace/yixinli/fmapp2017-android/app/build/generated/source/apt/debug

> Task :app:fastdexPatchForDebug
==fastdex pc   **resourceChanged: true** , assetsChanged: false, sourceChanged: false, manifestChanged: false
==fastdex receive: MetaInfo{buildMillis=1513670837182, variantName='Debug', mergedDexVersion=19, patchDexVersion=0, resourcesVersion=18}
==fastdex app  sendResourcesApk: true , sendPatchDex: false, sendMergedDex: false
==fastdex copy resources.ap_ 
copy : /Users/liangjunjie/Android/workspace/yixinli/fmapp2017-android/app/build/intermediates/res/debug/resources-debug.ap_ 
into: /Users/liangjunjie/Android/workspace/yixinli/fmapp2017-android/app/build/fastdex/Debug/res/temp/resources.apk

失败的日志:

> Task :app:fastdexPrepareForDebug
==fastdex hasDexCache: true
==fastdex discover dex cache for debug
==fastdex skip scan: /Users/liangjunjie/Android/workspace/yixinli/fmapp2017-android/app/build/generated/source/apt/debug
==fastdex remove apt-dir from old snapshoot.

> Task :app:fastdexScanAptOutputForDebug
==fastdex diff apt dir: /Users/liangjunjie/Android/workspace/yixinli/fmapp2017-android/app/build/generated/source/apt/debug

> Task :app:fastdexPatchForDebug
==fastdex pc   **resourceChanged: false** , assetsChanged: false, sourceChanged: false, manifestChanged: false
==fastdex receive: MetaInfo{buildMillis=1513670837182, variantName='Debug', mergedDexVersion=19, patchDexVersion=0, resourcesVersion=19}
==fastdex app  sendResourcesApk: false , sendPatchDex: false, sendMergedDex: false

应该是可以必现的,修改 textview 的 android:text="123", 然后再修改 android:text="1234",前面都生效,然后再修改回android:text="123"就不生效了。我猜应该是之前修改过的再修改回来就不生效了,比如"123" -> "1234" -> "12345"(都生效),但之后更改回"123","1234"就不生效了

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

No branches or pull requests

2 participants