Forums » C++ Framework » trouble creating a new android project »
| Ben Lee | trouble creating a new android project | ||
|---|---|---|---|
|
Added by Ben Lee over 1 year ago
Hi. I've looked all over for similar problem but can't seem to find the answer so I'm hoping someone could help me. In the androidmanifest.xml file, the line "android:icon="@drawable/icon">" it says no resource is found. That is simple enough to solve. I just copy the icon.png file into the res/drawable dir. In the <ProjectName>.java file, these 3 lines have errors: Right now, it can't find the R. But I noticed in the HelloWorld sample, it doesn't have the "import android.R" line. How do I fix this? I assume if I just run that simple script, it would generate the HelloWorld sample code for me to start with, and there would be no compile problems. Did I miss a step or overlook something. Would appreciate any help. BTW, I am using cocos2d-1.0.1-x-0.9.2. Thanks. |
||
| Minggo Zhang | RE: trouble creating a new android project | ||
|
Added by Minggo Zhang over 1 year ago
Build the android project in eclipse, then the R.java will be generated. |
||
| 令东 曾 | RE: trouble creating a new android project | ||
|
Added by 令东 曾 over 1 year ago
I occur the same problem while creating a project from exsisting source. If you config your Enviroment with android-ndk-r7+android-sdk_r08-windows+jdk1.7, you will occur: You should do this: 2. After creating your project with Eclipse, right click your project--properties--Java Compiler--select "Enable project specific settings" --select "Compiler compliance settings",set to"1.6"--Apply, that is all. I think this will help you, I am so sorry with my poor English. |
||
| xie zhen | RE: trouble creating a new android project | ||
|
Added by xie zhen over 1 year ago
i have the same problem, i did all in this article "http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter_1_-_How_to_Create_a_New_cocos2d-x_project_on_multi-platforms". but i can't find the var "game_demo" in R.layout, and the same of others. is it the version of android, i use android 2.1-update1(target: 3); |
||
| xie zhen | RE: trouble creating a new android project | ||
|
Added by xie zhen over 1 year ago
i'm sorry, before i build the project, i found there are some errors, so i import android.R to the file, so the errors appear, i remove "import android.R" the errors are solve. |
||
| Honghui Zhang | RE: trouble creating a new android project | ||
|
Added by Honghui Zhang over 1 year ago
That is some problem with create-android-project.sh, see Bug #866. Before the bug be fixed,you can copy the lost file and dirs from HelloWorld project to make your target project work. |
||
| Moc Interactive | RE: trouble creating a new android project | ||
|
Added by Moc Interactive 9 months ago
Hi there , i'm having a similar problem , but only when i import a exter sdk in my android project. setContentView(R.layout.game_demo); I'v clean and build , even restart the computer kkk , but the error 100% is in the import of SDK , somehow this import override the R compilation class. Any Idea? i'v already post in Gree forum , but nothing. Thanks Honghui Zhang wrote:
M.o.c Ministry of Code Android - https://play.google.com/store/apps/developer?id=Moc+Interactive |
(1-6/6)