MiCode / FileExplorer

MIUI文件管理器社区开源版(Community edition of MIUI File Explorer)
http://micode.net/forum-51-1.html
1.6k stars 763 forks source link

minor bug with env #2

Closed usc closed 12 years ago

usc commented 12 years ago

首先很感谢miui开源一些源码给我们,但是就拿这个来说,至少发现了几个问题,

  1. 并不是 Eclipse project(可能考虑大家使用的IDE不同,这个可以忽略)。
  2. 代码不能编译,缺少 R.java ,最重要而且最不可能落下的文件,竟然缺少了,难道是我的问题,不知还有这种写法,不需要这个文件也可以开发Android? 请开源的时候,保证代码能够编译和部署,好吗? 最基本的编程常识,难道MiCode 想借此提高我们的动手能力。
SunRain commented 12 years ago

R.java,如果在eclipse里面是会自动生成的,如果是用mmm编译,aapt(貌似是这个?)也是会在编译的司法自动生成的。 String.xml这个就不了解了 BTW,还没有编译过,木有4.0的jj,表示很无力

usc commented 12 years ago

sorry, 还是因为开源的不是 eclipse project,导致需要自己 new android project. 现在已经ok了,请 closed,不好意思。

daidaiwa commented 12 years ago

一般开源软件的习惯是不给IDE相关的配置文件,因为每个人习惯的IDE都不一样,没有太大意义,不过有的会给make,ant或maven的脚本 对于第二个问题,版本控制的一个最佳实践是,自动生成的代码不放在代码库中,而R.java如同.class文件一样,因为是自动生成的,所以都是不需要放进来的

usc commented 12 years ago

恩,确实是一个不错的实践。

cabral-tiago commented 12 years ago

sorry for writing in English but... i really didn't understand what you're talking because the translator isn't translating well.

But, can someone give instructions on how to compile this? i've tried in Eclipse and on a android build but it doesn't work both methods.

i've tried including the android.r but neither it worked. It's still missing things from that r.java

daidaiwa commented 12 years ago

You should make sure you have already installed ADT plugin (http://developer.android.com/sdk/eclipse-adt.html) first. Then you can create a new Android project from existing source in Eclipse (File -> New -> Android Project -> Create project from existing source). After the wizard, Eclipse will do all left stuffs for you including generating the gen folder to contains R.java.

usc commented 12 years ago

Above that has a very detailed(Create project from existing source is key), add i should add that this project only compile with Android4.0 or later + jdk1.6 (or later?), and if you find anything is wrong,please fix it first, this is the reasons for i missing R.java.
And i think maybe it's open with maven project, that will reduce a lot of environmental trouble above.

daidaiwa commented 12 years ago

A significant advantage of Maven is dependency management, but Android projects do not have complicated dependency situations indeed. Another reason is, Maven does not work well with Android projects, especially with ADT plugin in Eclipse, for instance, Maven will not consider gen folder is a source folder. So it is not quite necessary to introduce Maven in Android projects. However, you may try to use some Eclipse plugins or Maven plugins to resolve the integration issues.

cabral-tiago commented 12 years ago

i have that ADT plugin, and i've done that, but it's not working :S

i will update all Android SDK, get another distro of the Eclipse and reinstall the ADT, maybe the problem is there

cabral-tiago commented 12 years ago

i updated everything. i'm using SDK with Api Level 15. No R.Java problems and less errors given, but... there's still a few errors and warnings that don't let me build the package. Here, there are some screenshots of both Errors and Warnings list.

http://img585.imageshack.us/img585/4637/semttulo1he.png http://img823.imageshack.us/img823/1811/semttulo2thi.png

usc commented 12 years ago

i pull it and push it onto google code with svn. maybe you can try checkout it, at http://fileexplorer-android.googlecode.com/svn/trunk/ .

cabral-tiago commented 12 years ago

so, what's the difference between that source you've uploaded and the original one?

usc commented 12 years ago

nothing, but i want fork it and enhance it, and ing...

cabral-tiago commented 12 years ago

so, you sucessfully build it through eclipse or an android build?

usc commented 12 years ago

yes.

cabral-tiago commented 12 years ago

strange, i can't :S

wich api version r you using?

edit: i'm downloading now the api version 14, i had 15, let's see what happen if i use 14 on Eclipse

cabral-tiago commented 12 years ago

i got build problems... :s

same errors with Api 14

cabral-tiago commented 12 years ago

ok, i added android-support-v4.jar and added it to the class patch, also addded android-support-v13.jar to the class patch, now there's no building errors on Eclipse, only Warnings

it doesn't build any APK file