• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Package name modifying error

hellcode

Newbie
Hello,

I'm trying to modify this app for school purposes. There are 2 packages in the app. When I rename the first one name.bagi.levente.pedometer it's all ok, but when I try to rename the second one, name.bagi.levente.pedometer.settings, the app starts, but when I go to settings in the app, the app crashes every time.

Please help me, if you can.
Thank you in advance.
 

Attachments

If the Settings activity is crashing I would check two things first:

  1. The package name at the top of the Settings.java class
  2. Your '<activity android:name=".Settings
 
Ok, before I've checked that but before that I will give you this information, maybe I'm wrong there:

The original app has package named name.bagi.levente.pedometer and it has 14 .java files.There is another package or subpackage named
name.bagi.levente.pedometer.preferences with 3 .java files. Settings.java class is in the first main package.I've changed the name of the main package to ftn.master.ilija.code. When I do that, but I leave subpackage with the original name, the app works fine. When I rename subpackage to for example ftn.master.ilija.code.preferences, or anything else, the app runs, but when i go to settings in the app itself on the phone, the app crashes.

1. package name in my settings class is package ftn.master.ilija.code;
2. <activity android:name="ftn.master.ilija.code.Settings" is at the moment, where RunFTN is the main java file.
 
Have you checked your root directory project.properties?

Also, if you can post the error from logcat that would help figure out what's up.
 
This is project.PROPERTIES file
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-8
apk-configurations=

And LogCat:

08-22 16:45:55.720: D/memalloc(13260): /dev/pmem: Mapped buffer base:0x4fd38000 size:409600 offset:204800 fd:82
08-22 16:45:55.830: I/FitApp(13260): [ACTIVITY] onPause
08-22 16:45:55.830: I/FitApp(13260): [SERVICE] Unbind
08-22 16:45:55.920: D/memalloc(13260): /dev/pmem: Unmapping buffer base:0x4f7ea000 size:204800 offset:0
08-22 16:45:55.920: D/memalloc(13260): /dev/pmem: Unmapping buffer base:0x4fd38000 size:409600 offset:204800
08-22 16:45:56.000: W/Resources(13260): Converting to string: TypedValue{t=0x10/d=0xa a=-1}
08-22 16:45:56.010: W/dalvikvm(13260): threadid=1: thread exiting with uncaught exception (group=0x40adf9f0)
08-22 16:45:56.020: E/AndroidRuntime(13260): FATAL EXCEPTION: main
08-22 16:45:56.020: E/AndroidRuntime(13260): java.lang.RuntimeException: Unable to start activity ComponentInfo{ftn.master.ilija/ftn.master.ilija.code.Settings}: android.view.InflateException: Binary XML file line #36: Error inflating class name.bagi.levente.pedometer.preferences.StepLengthPreference
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.os.Looper.loop(Looper.java:137)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread.main(ActivityThread.java:4424)
08-22 16:45:56.020: E/AndroidRuntime(13260): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 16:45:56.020: E/AndroidRuntime(13260): at java.lang.reflect.Method.invoke(Method.java:511)
08-22 16:45:56.020: E/AndroidRuntime(13260): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
08-22 16:45:56.020: E/AndroidRuntime(13260): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
08-22 16:45:56.020: E/AndroidRuntime(13260): at dalvik.system.NativeStart.main(Native Method)
08-22 16:45:56.020: E/AndroidRuntime(13260): Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class name.bagi.levente.pedometer.preferences.StepLengthPreference
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.rInflate(GenericInflater.java:481)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.rInflate(GenericInflater.java:493)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.inflate(GenericInflater.java:326)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.inflate(GenericInflater.java:263)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1403)
08-22 16:45:56.020: E/AndroidRuntime(13260): at ftn.master.ilija.code.Settings.onCreate(Settings.java:24)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.Activity.performCreate(Activity.java:4465)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
08-22 16:45:56.020: E/AndroidRuntime(13260): ... 11 more
08-22 16:45:56.020: E/AndroidRuntime(13260): Caused by: java.lang.ClassNotFoundException: name.bagi.levente.pedometer.preferences.StepLengthPreference
08-22 16:45:56.020: E/AndroidRuntime(13260): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-22 16:45:56.020: E/AndroidRuntime(13260): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-22 16:45:56.020: E/AndroidRuntime(13260): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.createItem(GenericInflater.java:375)
08-22 16:45:56.020: E/AndroidRuntime(13260): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430)
08-22 16:45:56.020: E/AndroidRuntime(13260): ... 21 more
 
Thanks. Do you have a layout file that is referencing this: [HIGH]name.bagi.levente.pedometer.preferences.StepLength[/HIGH]

which would be the old name?
 
Yes that is the old name, and as far I can see I have only one layout file, but I might be wrong. In this file there is no reference to the old name. I've attached current version of the project that is giving this error, if it is any help.
 

Attachments

Back
Top Bottom