Change package name org.traccar.client

trkr8 years ago

Hi Team,

How i can change package name org.traccar.client to different name in Android Studio?

thanks

Anton Tananaev8 years ago

Do you want to change package name or application id?

trkr8 years ago

Hi Anton,

Is it possible to change both? The package name and application id

Anton Tananaev8 years ago

I don't know why would you change package name, but it's certainly possible to change both.

trkr8 years ago

I am trying to change it but I am getting errors in mainactivity can please tell me the correct steps to change this

Anton Tananaev8 years ago

What are the errors?

trkr8 years ago
  • cannot resolve symbol 'TrackingService' in TrackingService.class
  • cannot resolve symbol 'StatusActivity' in StatusActivity.class
  • cannot resolve symbol 'ShortcutActivity'
  • package R does not exist
Anton Tananaev8 years ago

Have you updated source code to match your new package name?

trkr8 years ago

Yes. I have tried different refactor methods in Android Studio but non of them works. can you please show me the correct way to rename the package.
Many thanks

Anton Tananaev8 years ago

Can you please explain the reason first.

trkr8 years ago

Hi Anton,
I just managed to change the package name. But now I have another issue; I am trying to change the gradle version from 1.6 to 2.2 or 2.12 in gradle property file, but it not changing! is the 1.6 set somewhere other than the gradle-wrapper.properties file ?

Here is the error log file:

D:\newapp\app>gradlew packageRegularRelease

FAILURE: Build failed with an exception.

  • Where:

Build file 'D:\mynewapp\app\build.gradle' line: 1

  • What went wrong:

A problem occurred evaluating project ':app'. > Gradle version 2.2 is required. Current version is 1.6. If using the gradle wrapper, try editing the distributionUrl in D:\mynewapp\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip

  • Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED Total time: 26.301 secs

Anton Tananaev8 years ago

Where did you find version 1.6? Traccar Client uses gradle version 2.6 at the moment.

trkr8 years ago

Hi Anton,
Perhaps because downloaded wrong file! Alright, So now I downloaded the last version 3.9 one from github, and without changing anything in the code I imported all the files into Android Studio, and I ran the following command:

gradlew packageRegularRelease
OR
gradlew assembleRegularRelease

but now i get this error:

could not create plugin of type "AppPlugin"

Can you please help.

Many thanks

Anton Tananaev8 years ago

It works for me. Try to run it from command line.

trkr8 years ago

Hi Anton,

I tried to run it form command line, but i keep getting this error:

D:\appone>gradlew.bat packageRegularRelease

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\appone\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not create plugin of type 'AppPlugin'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 20.02 secs