Recent

Author Topic: App crash after package name change  (Read 5292 times)

stab

  • Full Member
  • ***
  • Posts: 187
App crash after package name change
« on: November 22, 2012, 02:45:06 pm »
Hi,

Made and installed an app with a buttonclick and the Native ListView Dialog and it worked OK.

Then I tried to change package name to be able to install more than one app in a android device by changing "lcltest" to "something" in every file.
Succeeded to install and get the simple buttonclick to work but when I try to use the Native ListView Dialog the app just closes.

Regards
stab :(

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: App crash after package name change
« Reply #1 on: November 22, 2012, 04:03:05 pm »
In the project's file which is androidlcltest.lpr ,you can find like this line:  CDWidgetset.ActivityClassName := 'com/pascal/lcltest/LCLActivity';

Change it to correspond to your new package name.

This question is almost the same as this previous one: http://lazarus.freepascal.org/index.php?topic=18978.0

If this doesn't help, please copy here what "adb logcat" shows, as explained here: http://wiki.freepascal.org/Custom_Drawn_Interface/Android#Oh_no.21_My_LCL_Android_application_doesn.27t_work
« Last Edit: November 22, 2012, 04:04:40 pm by felipemdc »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: App crash after package name change
« Reply #2 on: November 22, 2012, 04:07:05 pm »

stab

  • Full Member
  • ***
  • Posts: 187
Re: App crash after package name change
« Reply #3 on: November 22, 2012, 06:50:42 pm »
Thanks for answering,

I changed lcltest to newpkg in files:

.lpr
android\abd_install
android\AndroidManifest.xml
android\build.sh
android\build_debug_apk.bat
android\res\values\strings.xml
android\res\values
android\src\com\pascal\lcltest\LCLActivity.java

and changed directory name:
android\src\com\pascal\lcltest\
to
android\src\com\newpkg\lcltest\

Was I supposed to only change
CDWidgetset.ActivityClassName := 'com/pascal/lcltest/LCLActivity';
to
CDWidgetset.ActivityClassName := 'com/pascal/myapp/LCLActivity';?

Attaching abdOK.log and adbFailed.log

Regards
stab

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: App crash after package name change
« Reply #4 on: November 23, 2012, 12:07:47 pm »
You need to change everywhere: In the directory name itself, in the "CDWidgetset.ActivityClassName :=", in the manifest file I think too... etc. I don't have a finished list of all places. But all of them should match.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: App crash after package name change
« Reply #5 on: November 23, 2012, 12:11:32 pm »
oho .... I found a bug there =) In one place the acticity name was hardcoded still =D

I fixed it now in revision 39352, so please update your lazarus and try again.

The log helped me fix it.

stab

  • Full Member
  • ***
  • Posts: 187
Re: App crash after package name change
« Reply #6 on: November 23, 2012, 11:23:48 pm »
Thanks alot,

Downloaded new version and tested, all work OK.

Regards
stab :D

 

TinyPortal © 2005-2018