Skip to content

Automatic SDK installation fails on OSX Big Sur #756

Closed

Description

@kevinstadler

On a fresh install of Android mode 4.5.1, when selecting automatic Android SDK installation it completes the ~250MB download but then fails with a "Bad news" error message.

For anyone else running into the same problem, I managed to set the SDK up manually in the following way:

  1. manually download the Android SDK Command-Line Tools and extract them into youruserdirectory/Library/Android/sdk/cmdline-tools/latest
  2. run ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-33"
  3. back in Processing, open Android mode, choose manual SDK and select the youruserdirectory/Library/Android/sdk directory

Activity

  1. ranaaditya commented on Sep 25, 2023

    @ranaaditya
    Member

    On a fresh install of Android mode 4.5.1, when selecting automatic Android SDK installation it completes the ~250MB download but then fails with a "Bad news" error message.

    For anyone else running into the same problem, I managed to set the SDK up manually in the following way:

    1. manually download the Android SDK Command-Line Tools and extract them into youruserdirectory/Library/Android/sdk/cmdline-tools/latest
    2. run ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-33"
    3. back in Processing, open Android mode, choose manual SDK and select the youruserdirectory/Library/Android/sdk directory

    Hi @kevinstadler , can you please provide Failed logs if possible, we can go through it, mostly error will be in setup I think.

    Thanks,
    Aditya

  2. kevinstadler commented on Sep 25, 2023

    @kevinstadler
    Author
    PLATFORM NAME macos
    processing.mode.android.AndroidSDK$BadSDKException: SDK could not be downloaded
    	at processing.mode.android.AndroidSDK.download(AndroidSDK.java:548)
    	at processing.mode.android.AndroidSDK.locate(AndroidSDK.java:509)
    	at processing.mode.android.AndroidMode.checkSDK(AndroidMode.java:168)
    	at processing.mode.android.AndroidMode.getSearchPath(AndroidMode.java:207)
    	at processing.mode.java.RuntimePathBuilder.buildModeSketchPath(RuntimePathBuilder.java:527)
    	at processing.mode.java.RuntimePathBuilder$CachedRuntimePathFactory.lambda$buildClasspath$0(RuntimePathBuilder.java:685)
    	at java.base/java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:210)
    	at processing.mode.java.RuntimePathBuilder$CachedRuntimePathFactory.buildClasspath(RuntimePathBuilder.java:684)
    	at processing.mode.java.RuntimePathBuilder.lambda$prepareSketchClassPath$0(RuntimePathBuilder.java:319)
    	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
    	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
    	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
    	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
    	at processing.mode.java.RuntimePathBuilder.prepareSketchClassPath(RuntimePathBuilder.java:321)
    	at processing.mode.java.RuntimePathBuilder.prepareClassPath(RuntimePathBuilder.java:290)
    	at processing.mode.java.PreprocService.preprocessSketch(PreprocService.java:452)
    	at processing.mode.java.PreprocService.mainLoop(PreprocService.java:134)
    	at java.base/java.lang.Thread.run(Thread.java:833)
    
  3. kabrio commented on Oct 9, 2023

    @kabrio

    hello,

    same problem here: processing 4.3, mac os 14

  4. added this to the 4.6 bugfixes milestone on Oct 30, 2023
  5. leoleakey commented on Jan 9, 2024

    @leoleakey

    2ND THAT : same problem here: processing 4.3, mac os 14

  6. todocono commented on Apr 6, 2024

    @todocono

    Thanks, @kevinstadler, for sharing this. Saved my day. I don't have the background to solve the issue, but I hope documenting my experience helps. I am experienced with Processing, but not with Android. The mode looks awesome and I would like to contribute at least with this.

    It has been a ride to get it working because the documentation was not easy to follow. I tried to use the instructions about installing the Studio as indicated on the Install page and failed. The inconsistencies started with the Installing from the IDE which, as reported by so many, fails with the automatic update.

    When installing and selecting the default Studio, it doesn't work. Setting the path from the preferences.txt doesn't solve the issue either. Many pages and forums mention using a wiki page which is down, that didn't help either.

    Then, the Getting Started page mentions installing manually the platform version 26, but the IDE asks for the version 33. Downgrading the SDK installed by Studio (which default installs version 35 to version 33 required by the current IDE), and installing the command tools, as indicated here, solved my headaches.

    Processing 4.3
    macOs 13.6.1

  7. alptugan commented on Apr 7, 2024

    @alptugan

    It took my whole Sunday. I fixed the issue by downloading Android studio. Follow the steps. Remove any old sdk folders inside you Processing's Android folder if there are any.

    My setup;

    • Mac OS 13.6.6 on Apple M2
    • Processing 4.3
    • Samsung A54 (Developer Mode enabled with the latest OS One UI 6.0, Android 14)
    1. Install your device’s software and drivers, if it is required. Mine is “Samsung Smart Switch”
    2. While installing the Samsung Smart Switch, your Mac will ask you for several permissions. Allow access from your Mac whenever prompted. This is required to make my phone identified by the computer.
    3. Download and Install the latest Android Studio.
    4. After the installation is done, open the Android Studio and click on SDK Manager
      Screenshot 2024-04-07 at 15 33 21
    5. Install SDK 33
      Screenshot 2024-04-07 at 15 30 28
    6. Then install Command Line Tools. It is required by Processing.
      Screenshot 2024-04-07 at 15 28 14
    7. Open the Processing App and choose to install Android Mode
      Screenshot 2024-04-07 at 15 35 58
    8. Select to set SDK manually option and choose the SDK path on your Mac. It should be as follows;
      /Users/<your_username>/Library/Android/sdk
    9. If you get no error, or warning, then you are good to go.
    10. Connect your Android device to your computer. Make sure your your device is identified by your computer. Hit the Run button and you will see the following image. It will install additional packages and deploy the app to your Android device.
      Screenshot 2024-04-07 at 16 09 06
    11. Hit Run
  8. rodolfoacostacastro commented on May 23, 2024

    @rodolfoacostacastro

    On a fresh install of Android mode 4.5.1, when selecting automatic Android SDK installation it completes the ~250MB download but then fails with a "Bad news" error message.

    For anyone else running into the same problem, I managed to set the SDK up manually in the following way:

    1. manually download the Android SDK Command-Line Tools and extract them into youruserdirectory/Library/Android/sdk/cmdline-tools/latest
    2. run ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-33"
    3. back in Processing, open Android mode, choose manual SDK and select the youruserdirectory/Library/Android/sdk directory

    in a mac with Sonoma 14.5 after I run the command I get:

    Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    Then locate the path manually in Processing still does not work. I will try alptugan metod (I´m just afraid of the automatic updates from the wizzard manager in Android Studio)

  9. codeanticode commented on Jun 10, 2024

    @codeanticode
    Contributor

    The SDK installation should be working again with version 4.6.0 of the mode: https://github.com/processing/processing-android/releases/tag/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions