我正在尝试使用ANT构建我的应用程序,并且在我加入google-play-services-lib库项目后,我失败了.
步骤1
我在project.properties文件中设置了对库项目的引用:
android.library.reference.1=/path/to/google-play-services_lib
Run Code Online (Sandbox Code Playgroud)
第2步
我在google-play-services_lib文件夹中运行了这些命令:
android update lib-project --path .
ant clean
ant release
Run Code Online (Sandbox Code Playgroud)
建立成功!
第3步
回到我的项目文件夹
ant clean
ant release
Run Code Online (Sandbox Code Playgroud)
错误
BUILD FAILED
/android/tools/ant/build.xml:460: /path/to/google-play-services_lib resolve to a path with no project.properties file for project /my/project-folder
Run Code Online (Sandbox Code Playgroud)
两个文件夹中都有一个project.properties.google-play-services_lib中的一个包含以下代码:
target=android-8
android.library=true
Run Code Online (Sandbox Code Playgroud)
我显然错过了一些就在我面前的东西,我非常感谢你的帮助.谢谢!
在使用setContentView(R.layout.mylayoutid)之前,有什么方法可以检查某个布局ID是否存在?
就像是:
if(layout_exists("mylayoutid"))
setContentView(R.layout.mylayoutid);
else
setContentView(R.layout.defaultlayout);
Run Code Online (Sandbox Code Playgroud)
在开发人员文档中找不到任何内容.
谢谢!