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

Demo2 访问 host 资源的问题 #24

Closed
MrFuFuFu opened this issue Nov 22, 2015 · 4 comments
Closed

Demo2 访问 host 资源的问题 #24

MrFuFuFu opened this issue Nov 22, 2015 · 4 comments

Comments

@MrFuFuFu
Copy link

如果如示例 demo 写的话,示例 demo 编译和访问 host 资源都没有问题

但是当我集成到我自己的项目中的时候,我把 sample 项目换成了我自己的项目,demo1 和 demo2 依然用你们的示例中的两个 demo1,
但是在我编译的时候:执行 :demo2:compileRelease 是会报错的,求解求解,去掉textView.setText(R.string.sample_text);imageView.setImageResource(R.drawable.sample); 的话,则没有问题,但这是不是说明我插件apk 就没有访问 host 资源的能力了~~求解

能不能帮忙解答一下,是准备用到线上的项目里去的,着急着急

:demo2:init
:demo2:aaptRelease UP-TO-DATE
:demo2:compileRelease
警告: [options] 未与 -source 1.7 一起设置引导类路径
/Users/Code/trunk_so/demo2/src/ctrip/android/demo2/MainActivity.java:15: 错误: 找不到符号
        textView.setText(R.string.sample_text);
                                 ^
  符号:   变量 sample_text
  位置: 类 string
/Users/Code/trunk_so/demo2/src/ctrip/android/demo2/MainActivity.java:17: 错误: 找不到符号
        imageView.setImageResource(R.drawable.sample);
                                             ^
  符号:   变量 sample
  位置: 类 drawable
2 个错误
1 个警告
:demo2:compileRelease FAILED
FAILURE: Build failed with an exception.

@TediWang
Copy link

检查一下这几点:
1.host 工程的包是否能正常打出来。
2.各Demo工程下的R文件是否包含了host工程的R文件内容。
从你的报错信息看,是第二步中没有宿主的R文件对应的资源ID

@wb-root
Copy link

wb-root commented Jan 8, 2016

@TediWang 检查后发现Demo2确实不包含Host工程的R文件内容,请问知道是什么原因或如何修改吗?

@wb-root
Copy link

wb-root commented Jan 8, 2016

@MrFuFuFu 请问你是否解决了问题?

@MrFuFuFu
Copy link
Author

MrFuFuFu commented Jan 8, 2016

@wb31137 你好,没有解决后续估计还会打算用携程的这套东西。但是对于资源重名的问题,和控件id 重名的问题很是困扰

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

3 participants