0

I have a a project with a lib inside it. The project has no resource of its own and all the reoources are in the lib On my build machine I'm using ant to build the project.
Until upgrading to ADT22 build was ok when building both from eclipse and ant.
After the upgrade the build fails for the cases when I modify the main project manifest in the ant build.xml. If I don't modify the manifest in the ant build.xml then the build is passed well. The problem that I see is that in that case R$ files are not generated in my main project but only in my lib project.
Edit:
The problem was because I changed the package name in the manifest during the ant build.
I Have two build.xml files. One for my main project and one for my lib project.
I moved the ant task that modify the package name to the main application build.xml to be the first -compile target depends.

<target name="-compile" depends="-backupFiles,-replaceManifestgName,-build-setup, -pre-build, -code-gen, -pre-compile>  


And this fixed my problem.
I guess something in the way ADT22 handle the ant build was change and this is what cause the problem since with previes ADTI didnt Have problems

  • try this one just asked some one http://stackoverflow.com/questions/17440595/r-cannot-be-resolved-may-have-wrong-build-path-or-libraries-import/17440632?noredirect=1#comment25338733_17440632 – Sunil Kumar Jul 03 '13 at 08:21
  • this is related to building from eclipse but I don't have problem building from eclipse. Only when building from ant and modifying the manifest during the build.xml – user1594877 Jul 03 '13 at 09:04

3 Answers3

0

try to close ecplise and run it again

Ahmad Dwaik 'Warlock'
  • 5,953
  • 5
  • 34
  • 56
0

When switching between ant and Eclipse you need to clean the project first. So either ant clean or Eclipse>Project>Clean....

Running android update project -p ./ may help, too. It seems the behaviour started appearing since ADT 22.

Joel Bodega
  • 644
  • 5
  • 8
  • I do clean all dirs before doing the build so its not the issue.
    running android update also didn't change anything in my build.xml
    – user1594877 Jul 03 '13 at 08:42
  • Is your project a library? It all seems as if ADT is not so compatible with an older ant, anymore. Ant in the repos, unless in rolling releases, appears to be sitting at 1.8.x. Cleaning the project usually fixes the ant/ADT shenanigans – Joel Bodega Jul 03 '13 at 08:55
  • yes. most of my code is in a library. and Im using ant 1.8.3 . and I do clean inside the ant all directories before starting. – user1594877 Jul 03 '13 at 09:03
0

The problem was because I changed the package name in the manifest during the ant build.
I Have two build.xml files. One for my main project and one for my lib project.
I moved the ant task that modify the package name to the main application build.xml to be the first -compile target depends.

<target name="-compile" depends="-backupFiles,-replaceManifestgName,-build-setup, -pre-build, -code-gen, -pre-compile>  


And this fixed my problem.
I guess something in the way ADT22 handle the ant build was change and this is what cause the problem since with previes ADTI didnt Have problems