Problems with apps build agains iOS4 and Base SDK 3

1,572 views
Skip to first unread message

Yosi

unread,
Jun 20, 2010, 11:10:22 AM6/20/10
to Three20
I'm using xCode 3.2.3 , I managed to compile and run my app using
these settings:
SDKROOT = iphoneos4.0
IPHONEOS_DEPLOYMENT_TARGET = 3.0

Running on iOS4 works fine BUT running on OS3 causes problems when
keyboards pops up and then app crashes. I nailed it down to these kind
of ifdef around three20:

#if __IPHONE_3_2 && __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED


The problem is that this code checks against
__IPHONE_OS_VERSION_MAX_ALLOWED which is not the right logic - it
should check against the IPHONEOS_DEPLOYMENT_TARGET version.
When checking against the __IPHONE_OS_VERSION_MAX_ALLOWED and running
on OS3 the app will crash because selectors that doesn't exist on the
OS3 are called.

-yosi

dlyon

unread,
Jun 21, 2010, 9:29:34 AM6/21/10
to Three20
yosi,

Thanks for bringing this up. I've just encountered this problem
myself, and I believe you are correct as far as the section of code
causing the crash, however changing the check to use
__IPHONE_DEPLOYMENT_TARGET still causes the app to crash on 3.1.3. If
you've found a working solution to this, any chance you could fork the
project on github and send a pull request with the fix? I've tried
several things to fix this, and I'm currently stumped. Hopefully
someone will get a patch out soon!

-- Dave

Jean Regisser

unread,
Jun 21, 2010, 11:38:04 AM6/21/10
to thr...@googlegroups.com
I've made a patch for that: http://gist.github.com/423702
It does a runtime check to know what to call (and hence not crash).

Jean

> --
> You received this message because you are subscribed to the Google Groups "Three20" group.
> To post to this group, send email to thr...@googlegroups.com.
> To unsubscribe from this group, send email to three20+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/three20?hl=en.
>
>

dlyon

unread,
Jun 21, 2010, 1:34:30 PM6/21/10
to Three20
Shouldn't there be some way to do this without having to weak-link
UIKit?

Yosi

unread,
Jun 23, 2010, 5:55:03 AM6/23/10
to Three20
I simply changed it to
#if __IPHONE_3_2 && __IPHONE_3_2 == __IPHONE_OS_VERSION_MAX_ALLOWED

I know it's a hack but it works. I've verified it both on iphone 2g,
3g,3gs(ios4) and ipad.

I don't know what the right solution here.

Alex

unread,
Jun 23, 2010, 6:08:21 AM6/23/10
to Three20
different Problem here, running latest three20 on xcode 3.2.3 tried to
launch the demo app on a iOS4 iPhone 3GS, with Error: "Error from
Debugger: The Programm being debugged is not being run".

Changed the SDK in all three20 projects to "iphone device 4.0" wich
isn't missing.

What can i do to run an three20 App on a iOS4 Device? Simulator is
working quite fine!

Greetings Alex

Yosi

unread,
Jun 23, 2010, 7:03:18 AM6/23/10
to Three20
see this patch: http://github.com/zila/three20/commit/3190fbd40131b25e5908b7a8dcc85b9fef76a62d
I used it and managed to compile and run both on device and simulator

Alex

unread,
Jun 23, 2010, 8:05:32 AM6/23/10
to Three20
doesn't work, same problem: "Error from
Debugger: The Programm being debugged is not being run"

On 23 Jun., 13:03, Yosi <y...@taguri.com> wrote:
> see this patch:http://github.com/zila/three20/commit/3190fbd40131b25e5908b7a8dcc85b9...

dlyon

unread,
Jun 23, 2010, 8:40:51 AM6/23/10
to Three20
This may sound silly, but have you tried restarting both the device
and the computer? I had a similar problem, and that was what solved
it for me.

Alex

unread,
Jun 23, 2010, 9:14:35 AM6/23/10
to Three20
yes, rebooting macbook and restarting phone doesn't help :/

i've used a fresh project with three20 template, only changing the
Bundle identifier for developing on device... debugger error...

Brett

unread,
Jun 23, 2010, 4:49:19 PM6/23/10
to Three20
I am having the exact same problem as Alex. Done all of the above
suggestions with no luck. Simulator works great. iOS on my 3G crashes
as soon as the app starts with debugger error. Of course, there is no
info as to what the debugger error is.

If anyone has a solution, please let us know.

Cheers,
Brett

Yosi

unread,
Jun 23, 2010, 5:59:44 PM6/23/10
to Three20
when you change the project files like in the commit I mentioned
before make sure your xcode is closed.

Verads

unread,
Jun 24, 2010, 10:05:26 AM6/24/10
to Three20

Same problem here and Yosi patch solved it.
Thanks for sharing Yosi :-)

troppoli

unread,
Jun 24, 2010, 4:22:18 PM6/24/10
to Three20
We seemed to work around this by simply tweaking the project settings
in all the Three20 project files
Set the base SDK to iPheond Device 4.0 and the deploy target to what
you want, like 3.1.2. No editing of source required...

ala:
http://github.com/ECP/three20/commit/49b3452bd6fe916d67528fd3e18a629156bf5534

-steve

uprise78

unread,
Jun 24, 2010, 5:35:11 PM6/24/10
to Three20
Yeah, what he said. Just go through all the dependency projects and
reset the Base SDK to 4.0 and you should be good (or use Yosi's fork
which does this for you). Don't forget to delete and recreate your
Entitlements.plists as well if you plan on submitting to Apple.



On Jun 24, 1:22 pm, troppoli <tropp...@gmail.com> wrote:
> We seemed to work around this by simply tweaking the project settings
> in all the Three20 project files
> Set the base SDK to iPheond Device 4.0 and the deploy target to what
> you want, like 3.1.2. No editing of source required...
>
> ala:http://github.com/ECP/three20/commit/49b3452bd6fe916d67528fd3e18a6291...
>
> -steve

Alex

unread,
Jun 25, 2010, 9:26:30 AM6/25/10
to Three20
Ok ppl, thanks for help, i have solved the problem.... created a new
prov. profile, delete the old one and use the new profile fixed the
problem...

Alex

Yosi

unread,
Jun 27, 2010, 2:43:10 AM6/27/10
to Three20
A small change I noticed today is
http://github.com/sadatrahman/three20/commit/47b0bd7e9ff5b533f56ede5d4bf2cfc7838acbda
looks like something I need to check but looks promising so far.

troppoli

unread,
Jun 28, 2010, 9:50:53 AM6/28/10
to Three20
An addendum... we also had to modify all the
__IPHONE_OS_VERSION_MAX_ALLOWED occurrences in Three20 to be
IPHONEOS_DEPLOYMENT_TARGET

The existing logic was clearly wrong if you are building against base
SDK4 and are supporting 3.1.x. __IPHONE_OS_VERSION_MAX_ALLOWED would
be 4.0 so you would not compile against the old, in many cases
deprecated APIs. You need to see warnings if it is going to run on
3.1.x.

http://github.com/ECP/three20/commit/44800b1eec2dd8b07db8b94bda9d6e1ffcf85148

-steve

On Jun 24, 4:22 pm, troppoli <tropp...@gmail.com> wrote:
> We seemed to work around this by simply tweaking the project settings
> in all the Three20 project files
> Set the base SDK to iPheond Device 4.0 and the deploy target to what
> you want, like 3.1.2. No editing of source required...
>
> ala:http://github.com/ECP/three20/commit/49b3452bd6fe916d67528fd3e18a6291...

aweder

unread,
Jul 12, 2010, 10:40:21 AM7/12/10
to Three20
troppoli,

this is an important contribution. I've experienced these crashes as
well, applied your changes and that fixed the problem.

Have you considered adding a defect against Three20 in the issue
tracker? If you don't have the time, I'll do that, no without
mentioning your authorship, of course.

Thanks
Andreas

On Jun 28, 3:50 pm, troppoli <tropp...@gmail.com> wrote:
> An addendum... we also had to modify all the
> __IPHONE_OS_VERSION_MAX_ALLOWED occurrences in Three20 to be
> IPHONEOS_DEPLOYMENT_TARGET
>
> The existing logic was clearly wrong if you are building against base
> SDK4 and are supporting 3.1.x.  __IPHONE_OS_VERSION_MAX_ALLOWED would
> be 4.0 so you would not compile against the old, in many cases
> deprecated APIs. You need to see warnings if it is going to run on
> 3.1.x.
>
> http://github.com/ECP/three20/commit/44800b1eec2dd8b07db8b94bda9d6e1f...
Reply all
Reply to author
Forward
0 new messages