Common Android Deployment issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 29
- Joined: Tue Jun 27, 2006 8:35 pm
- Location: Bellingham, WA USA
- Contact:
Re: Common Android Deployment issues
I have had the same issue for a while now, with the "JDK Path:" being empty. If I remember correctly, it happened when I updated to the Arctic Fox version of Android Studio. I have been able to build and install on a test device and run the simulator but I don't think I have tried submitting to the Google Play Store since this occurred. I'm interested in what's up with this, too.
Elementary Software
...now with 20% less chalk dust!
...now with 20% less chalk dust!
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
I find it "interesting" that LiveCode goes out of its way to make selecting the Android sdk location hard.
Note that there are helpful error messages that have all been commented out in favor of just returning a boolean.
I hacked up my LC 10.3 IDE code in the following way:
In revDeployLibraryAndroid:
and in button "Choose Android" of stack "revPreferencesGUI" to accomodate the error messages:
Note that there are helpful error messages that have all been commented out in favor of just returning a boolean.
I hacked up my LC 10.3 IDE code in the following way:
In revDeployLibraryAndroid:
Code: Select all
function deployIsValidSDK pPath
if there is no folder (pPath & slash & "platforms") or \
there is no folder (pPath & slash & "platform-tools") or \
there is no folder (pPath & slash & "tools") then
return "could not find platforms, platform-tools or tools folders at that path."
--return false
end if
if there is no folder pathToRootPlatform(pPath) then
return "could not find install of required target SDK, make sure it has been installed with the Android SDK Manager"
--return false
end if
if there is no file pathToRootClasses(pPath) then
return "missing root classes, make sure your SDK install has not become corrupted"
--return false
end if
if there is no file pathToAapt(pPath) then
return "missing aapt tool, make sure your SDK install has not become corrupted"
--return false
end if
if there is no file pathToAdb(pPath) then
return "missing adb tool, make sure your SDK install has not become corrupted"
--return false
end if
if there is no file pathToSDKClasses(pPath) then
return "missing sdklib.jar, make sure your SDK install has not become corrupted"
--return false
end if
if there is no file pathToZipAlign(pPath) then
return "missing zipalign tool, make sure your SDK install has not become corrupted"
--return false
end if
if there is no file pathToD8(pPath) then
return "missing d8 tool, make sure your SDK install has not become corrupted"
--return false
end if
return empty
end deployIsValidSDK
Code: Select all
on mouseUp
local tPath, tIsValid
answer folder "Please choose the location of your Android development SDK"
if it is not empty then
put it into tPath
put revIDEDeployAndroidIsValidSDK(tPath) into tIsValid
if tIsValid is empty then
setAndroidSDK tPath
else
answer tIsValid
--answer error "The chosen folder is not a valid Android SDK. Please ensure you have installed it correctly, and enabled support for" && revIDEDeployAndroidRequiredSDK()
end if
end if
end mouseUp
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Common Android Deployment issues
Now I'm getting the same error about an invalud SDK. I do have Android 11 (30) installed and LC sees the JDK. When I run revIDEDeployAndroidRequiredSDK() it returns 11(30). I have Android-30 installed in the platforms folder (and somehow Android-31 as well, not sure if that matters.) My tools folder is old, 26.1.1 with no update listed as available. Platform Tools is 31.0.3 with an available update to 33.0.2. Everything was installed via Android Studio.
I can test to a cabled Android phone fine, but I can't build a standalone. So now what?
Running Mac OS Monterey, LC 9.6.7. Back on Big Sur I don't think I had this problem.
Edit: Build-tools 33 is available but not installed. Should I?
I can test to a cabled Android phone fine, but I can't build a standalone. So now what?
Running Mac OS Monterey, LC 9.6.7. Back on Big Sur I don't think I had this problem.
Edit: Build-tools 33 is available but not installed. Should I?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
I see 11 (API 30) in response to that function.
Have you hacked up those two handlers to see where the error is taking place? Returning "false" from deployIsValidSDK() isn't very useful.
Have you hacked up those two handlers to see where the error is taking place? Returning "false" from deployIsValidSDK() isn't very useful.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Common Android Deployment issues
I was working from memory, I do see 11 (API 30).
I changed the scripts as you suggested, restarted LC, and got an error that I needed to select my SDK. The change apparently wiped out my previous setting. I made the selection, got no errors, but now it doesn't see my JDK. I'm betting that means I can't even shoot an app to my phone.
Of course, they don't give us a way to select the location of the JDK.
Edit: every time I close Prefs, it wipes out my SDK field. I need to revert back to the original.
I changed the scripts as you suggested, restarted LC, and got an error that I needed to select my SDK. The change apparently wiped out my previous setting. I made the selection, got no errors, but now it doesn't see my JDK. I'm betting that means I can't even shoot an app to my phone.
Of course, they don't give us a way to select the location of the JDK.
Edit: every time I close Prefs, it wipes out my SDK field. I need to revert back to the original.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
You *do* have sdk 8 installed as well, right?
It takes a bit more IDE hacking to get just 11 working by itself.
It takes a bit more IDE hacking to get just 11 working by itself.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Common Android Deployment issues
So, I have no idea what's going on. I deleted my altered copy of LC 9.6.7 and reinstalled from Time Machine's backup from earlier today before I made the changes. It now sees my SDK and JDK and builds an Android standalone. Yes, JDK 8 is installed and has been for a long time.
This is the exact same copy I was using yesterday when I had the problem. I'm at a loss.
Edit: I wonder if wiping the SDK pref was actually the fix.
This is the exact same copy I was using yesterday when I had the problem. I'm at a loss.
Edit: I wonder if wiping the SDK pref was actually the fix.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
From memory, I think sdk 11 (and maybe 10) place the jdk differently... it's internal so you don't explicitly have to specify where the jdk is. Or something like that. It's been a while.
I just now selected (on linux, ymmv) the sdk at /home/mwieder/Android/Sdk and it (the preferences selector) automatically filled in the jdk location with my $JAVA_HOME location
I just now selected (on linux, ymmv) the sdk at /home/mwieder/Android/Sdk and it (the preferences selector) automatically filled in the jdk location with my $JAVA_HOME location
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Common Android Deployment issues
I don't think it was so much the change in the SDK version, but rather the requirement that we use Android Studio to manage SDKs. Studio places it's SDKs in the user library folder, where before I'd had it in one of my own folders. But I adjusted LC's prefs location some time ago.
My experience could also be due to using an RC copy of LC at first. When that didn't work I moved back to LC 9.6.7 and it still failed. My current theory is that 9.6.8 RC 2 damaged the prefs file somehow. But that's just a guess.
My experience could also be due to using an RC copy of LC at first. When that didn't work I moved back to LC 9.6.7 and it still failed. My current theory is that 9.6.8 RC 2 damaged the prefs file somehow. But that's just a guess.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
That.
Yeah - I've found that if I switch versions and I haven't already selected the sdk location in the newly-selected version I will lose the setting more often than not.
Yeah - I've found that if I switch versions and I haven't already selected the sdk location in the newly-selected version I will lose the setting more often than not.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Common Android Deployment issues
Hello,
I've recently upgraded my pc and since then I've not been able to get android sdk to be recognized.
I've tried everything that is in this thread and i followed the lesson.
I'm on windows 11, 9.6.9 RC 2 ... have SDK 12 API 31 installed, AND the build and command tools installed as well
pointing to the C:\Users\tom\AppData\Local\Android\Sdk folder, which is what is in the box of the studio sdk manager,
Its all there
Still "not a valid SDK"
jdk folder is blank even though java 8 is installed.
I'm out of ideas. Please help.
TIA
Tom
I've recently upgraded my pc and since then I've not been able to get android sdk to be recognized.
I've tried everything that is in this thread and i followed the lesson.
I'm on windows 11, 9.6.9 RC 2 ... have SDK 12 API 31 installed, AND the build and command tools installed as well
pointing to the C:\Users\tom\AppData\Local\Android\Sdk folder, which is what is in the box of the studio sdk manager,
Its all there
Still "not a valid SDK"
jdk folder is blank even though java 8 is installed.
I'm out of ideas. Please help.
TIA
Tom
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
Tom-
Try monkeypatching the IDE stacks. The following will at least give you reasonable clues about what's missing.
Look in the revDeployLibraryAndroid stack.
In the deployIsValidSDK handler uncomment all the validation strings and comment the "return false" statements.
Then in the deployAutoconfigure handler change the first conditional to
In stack revSaveAsAndroidStandalone in handler revSaveAsMobileStandalone
patch the code after the call to revIDEDeployAndroidIsValidSDK to
Try monkeypatching the IDE stacks. The following will at least give you reasonable clues about what's missing.
Look in the revDeployLibraryAndroid stack.
In the deployIsValidSDK handler uncomment all the validation strings and comment the "return false" statements.
Then in the deployAutoconfigure handler change the first conditional to
Code: Select all
if tSDK is not empty and deployIsValidSDK(tSDK) is not empty then
patch the code after the call to revIDEDeployAndroidIsValidSDK to
Code: Select all
put revIDEDeployAndroidIsValidSDK(tPath) into tErrorMessage
if tErrorMessage is not empty then # now returns an error string
throw revIDELocalise("The chosen folder in Preferences -> Mobile Support" & \
" is not a valid Android SDK because" && tErrorMessage & ". " &\
"Please ensure you have installed it correctly," & \
" and enabled support for") && revIDEDeployAndroidRequiredSDK()
end if
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Common Android Deployment issues
Thank you Sir I will be trying this tomorrow.mwieder wrote: ↑Tue Jan 10, 2023 6:32 amTom-
Try monkeypatching the IDE stacks. The following will at least give you reasonable clues about what's missing.
Look in the revDeployLibraryAndroid stack.
In the deployIsValidSDK handler uncomment all the validation strings and comment the "return false" statements.
Then in the deployAutoconfigure handler change the first conditional toIn stack revSaveAsAndroidStandalone in handler revSaveAsMobileStandaloneCode: Select all
if tSDK is not empty and deployIsValidSDK(tSDK) is not empty then
patch the code after the call to revIDEDeployAndroidIsValidSDK toCode: Select all
put revIDEDeployAndroidIsValidSDK(tPath) into tErrorMessage if tErrorMessage is not empty then # now returns an error string throw revIDELocalise("The chosen folder in Preferences -> Mobile Support" & \ " is not a valid Android SDK because" && tErrorMessage & ". " &\ "Please ensure you have installed it correctly," & \ " and enabled support for") && revIDEDeployAndroidRequiredSDK() end if
There is hope
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Re: Common Android Deployment issues
This worked perfectly to help me track down the problem.
so far no "tools" folder and no sdklib.jar found.
My plan is to replace these files manually.
The error message hack really helped.
lesson for us all to just incllude the error message.
Cheers,
Tom
so far no "tools" folder and no sdklib.jar found.
My plan is to replace these files manually.
The error message hack really helped.
lesson for us all to just incllude the error message.
Cheers,
Tom
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Common Android Deployment issues
Ah... yes, I remember having to create a Tools folder manually.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev