Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly change the package name in AndroidManifest.xml (e.g. in project zxing/barcodescanner)

I'm pretty new to android development, so I hope my question is easy, but not completely stupid. I'm using Eclipse to build an android application. It is based on the barcode-scanner of the ingenious guys from zxing. I already did quite some changes to the original code and everything works fine. But I still have the problem, that the original barcode-scanner and my app cannot run simultaneously on one mobile device. As far as I could find out, the problem is the package name. So I tried to change it to something else. But that srew up my entire project, because I can't access my resources anymore (e.g. findViewById(R.id.btDone); <-- R cannot be resolved to a variable).

Can anyone tell me what else I have to change to make my code work again?

This the beginning of my AndroidManifest.xml where I tried to change the package name:

<manifest
  xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.google.zxing.client.android"
  ...

I also found an interesting entry in build.properties: (?!)

application-package=com.google.zxing.client.android

Thanks you guys!

like image 563
Thassilo Avatar asked Dec 13 '22 05:12

Thassilo


1 Answers

This should do it: Right Click on project -> Android Tools -> Rename Application Package

like image 118
Scalarr Avatar answered Jan 05 '23 00:01

Scalarr