# Dev help needed...



## adil (Nov 25, 2012)

Hello guys...
I may be new here, but I'm trying compile AOSP gingerbread for Samsung galaxy ace since a long time...

Till now I've fixed a lot of issues but can't fix RIL, as the samsung RIL sources are closed...

So I copied SamsungRIL.java from cm repo into the required directory... But I get the following errors while compiling...

http://pastebin.com/seHUJ7VC

As this is my first big project and new to java as well, I need help...

So any kind will be appreciated...

Thanks....


----------



## JBirdVegas (Jun 11, 2011)

So all the code after line 5 fail? Show us the first 10 lines... Looks like a syntax error


----------



## yarly (Jun 22, 2011)

You either have a syntax error like jbird said or you are missing code dependencies. No one will know though unless you paste the first 5-10 lines of code from that file.


----------



## adil (Nov 25, 2012)

Here are the first few lines...


```
<br />
package com.android.internal.telephony;<br />
import java.util.ArrayList;<br />
import java.util.Collections;<br />
import android.content.BroadcastReceiver;<br />
import android.content.Context;<br />
import android.content.Intent;<br />
import android.content.IntentFilter;<br />
import android.net.ConnectivityManager;<br />
import android.os.Handler;<br />
import android.os.Message;<br />
import android.os.AsyncResult;<br />
import android.os.Parcel;<br />
import android.os.SystemProperties;<br />
import android.telephony.PhoneNumberUtils;<br />
import android.telephony.SmsManager;<br />
import android.telephony.SmsMessage;<br />
import android.telephony.TelephonyManager;<br />
import static com.android.internal.telephony.RILConstants.*;<br />
```
Since the file is taken directly from cm repo, I don't think that there is any syntax error...
So, the error may be due to dependencies...

Thanks...


----------



## yarly (Jun 22, 2011)

ddependency issues


----------



## adil (Nov 25, 2012)

But how solve the issue?
sorry if sound like a noob, but this is my first project. So need help...


----------



## imnuts (Jun 9, 2011)

You're going to have to go through and compare the dependencies of the Samsung RIL in your tree to those from CM where you pulled it from. Odds are, there were changes made in other java files related to the RIL that are also required, and you're going to need to pull them in to your local tree as well.


----------



## adil (Nov 25, 2012)

imnuts said:


> You're going to have to go through and compare the dependencies of the Samsung RIL in your tree to those from CM where you pulled it from. Odds are, there were changes made in other java files related to the RIL that are also required, and you're going to need to pull them in to your local tree as well.


So is there is any command to compare the dependencies?

again sorry for noob question...


----------



## yarly (Jun 22, 2011)

adil said:


> So is there is any command to compare the dependencies?
> 
> again sorry for noob question...


Any number of diff tools or an IDE. An IDE is too advanced for you though I would guess and would just lead to a bajillion other questions unrelated.


----------



## adil (Nov 25, 2012)

yarly said:


> Any number of diff tools or an IDE. An IDE is too advanced for you though I would guess and would just lead to a bajillion other questions unrelated.


Wait, aren't the diff tools used to compare two files? then what about dependencies?


----------



## yarly (Jun 22, 2011)

adil said:


> Wait, aren't the diff tools used to compare two files? then what about dependencies?


Compare one ROM to the other directory wise with a diff tool and find out what telephony files are missing or not the same, add them in, then recompile until the errors go away.

The only tool for dependencies I use is an IDE, which if done correctly, checks for missing classes on the fly, but I think that's way too beyond your scope to explain how to load it into Intellij IDEA or Eclipse right now (besides the fact it would take a very very long time and a lot of typing to explain). Also requires a beast of a computer to use without it being slow.

On that, I think you should just go with a diff tool to save everyone some time unless you wish to learn how to use an IDE on your own for a while (a while being quite a while before you start to benefit from it). I also don't use Eclipse (but others do, so they might be able to help there) and there aren't really any guides to using Intellij with the Android Source so it's mostly something you pick up from patience, experience and the time to screw around with it.

tl;dr go with a diff tool and everyone will be much happier.


----------



## imnuts (Jun 9, 2011)

How I would go about fixing this would be as follows:

Start a build on just one thread (ie. make -j1 otapackage)
When the build errors, look at what is missing in the build error message
Use grep to find the missing class/method in the CM source
Once the info is found, add it in to the appropriate file(s) in your source tree
Repeat, starting at step 1 until there are no more build errors
Once it builds the whole way through, run make clobber to delete everything, and re-compile to make sure nothing was missed.


----------



## adil (Nov 25, 2012)

imnuts said:


> How I would go about fixing this would be as follows:
> Start a build on just one thread (ie. make -j1 otapackage)
> When the build errors, look at what is missing in the build error message
> Use grep to find the missing class/method in the CM source
> ...


Sorry, I was busy with college stuff.
I tried with -j1 and found the missing packages. But I can't find them in CM source. When I use grep <package name>, nothing happens. 
So is there any specific command or anything else that I can try?
Thanks.


----------



## yarly (Jun 22, 2011)

Give an example of what exactly you are entering when you try to grep. I mean that literally (as in pretend your next reply is the terminal) and not an English explanation. Though you can provide an explanation in addition.


----------



## adil (Nov 25, 2012)

yarly said:


> Give an example of what exactly you are entering when you try to grep. I mean that literally and not an English explanation.


grep android.os


----------



## yarly (Jun 22, 2011)

Thing is, you're supposed to grep the missing classes, not the packages exactly (the class shows up in the error messages). The packages contain the classes and the packages map to a filesystem location (which is common to nearly all programming languages when dealing with packages/namespaces/modules/includes). In your case, that would be frameworks/base/core/java/android/os.

Further information, look up how packages in java work.


----------



## adil (Nov 25, 2012)

yarly said:


> Thing is, you're supposed to grep the missing classes, not the packages exactly (the class shows up in the error messages). The packages contain the classes and the packages map to a filesystem location (which is common to nearly all programming languages when dealing with packages/namespaces/modules/includes). In your case, that would be frameworks/base/core/java/android/os.
> 
> Further information, look up how packages in java work.


The classes which are being shown as missing are all present...
Shall I replace them with the ones from cm?

Edit:I think I should better read about java a bit, then I'll continue...


----------



## yarly (Jun 22, 2011)

I don't know what your background is in programming and such, but you do need to at least know the basics of Java, how Android uses it and the filesystem structure for Android if you wish to port and compile something and make it work.

You already seem to realize that, which is good. Most errors are like this are hard to answer remotely so it's best if you can eventually solve them on your own. It's probably some sort of misconfiguration, but even if it's what you think and "drag and drop" those files in there, there's no guarantee that would work either. They would also have unresolved dependencies most likely.


----------

