I am just launching in to a port of an iPad app to Chromebook. After getting through the expected pile of syntax errors, I finally got my code to get into the compiler, which came back with:
Android Compiler. Unknown Reference: catch.
I have submitted a report (#77836) which awaits confirmation that it is a real crash.
I subsequently tried to shrink my app to see if I could get a minimal version to compile. Now I get:
Android compiler: Type mismatch: inferred type is int but double /* = xojonumber*/ was expected.
I am trying to set my expectations. Have compiler crashes been common? When they have arisen, have they gotten attention?
I have had Android compiler errors that have disappeared after I restarted Xojo and tried again.
It is very unpredictable and I haven’t managed to correlate it with anything in particular.
Xojo for Android is a Public Beta and depends on Android Studio, and Android Studio changes a lot sometimes affecting Xojo. So report anything not ok. Every Xojo release its Android target version has lots of fixes.
1 Like
The Android compiler is 100% different than what the other projects use. There are certainly going to be issues (they are not crashes, though).
Small sample projects that demonstrate the problem are addressed quickly, which you can see in the release notes. Sometimes we can point out workarounds in the interim. Be sure to try the pre-release if you’re able as well.
If you are moving a project over from iOS, to make your life easier I recommend doing in small parts rather than all at once. iOS has been around for 10 years now, Android is still in beta and has only been out for just over a year.
Hello Paul.
Thank you for jumping in. Android is all new to me. I did not know how to begin except to just dump my iPad version in and see what happened. So that is what I did.
I don’t really need an iPad version but it seemed like a good first step since my Mac/windows code is ancient, huge, and still in api 1. It was a grind but I have a nice subset working.
I am very excited about the Chromebook possibilities and fully aware that it is early days. I survived the early days of realbasic too.
Hello again Paul.
I think I need some overall guidance from you as I engage with Android. When I do get issues, I want to do as much as I can on my end to make them simple to understand. As I mentioned in my note, when I started ripping stuff out to simplify, the compiler error changed.
One comment I got that I don’t understand yet is “After a first Quick Look, it seems like you copy & pasted over your iOS Screens to the Android Project. This could be the first area which causes errors.” I was assuming that screens were mobile objects that could be cut from iOS and pasted to android.
Also, is there a place to put my my media files? In Mac/windows/iOS I have the “Copy Files” facility in Build Settings. Apparently, Android has “External Storage” and “Resources” but I am not sure how to use them. (My full media folder is huge but read only.)
Thanks again for your guidance and patience.
James
The UI framework uses the same names between iOS and Android for convenience. At some point in the future, we plan to have a single "mobile’ project type.
But that time is not now. Copying UI components between iOS and Android might work, but there are event and property differences that could cause troubles. I’d avoid doing that right now.
Use a Copy Files Build Step and choose Resources. Then use SpecialFolder.Resource or SpecialFolder.Resources to get them. This should work the same as iOS.