question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

faulty "isAndroid" behavior on Desktop

See original GitHub issue

Hello!

Expected behavior

isAndroid returns true only if running on Android

Actual behavior

isAndroid returns true on Desktop if there is an Android SDK on the classpath

Steps to reproduce

Add Android SDK to the classpath and run with OpenJDK. PlatformDependent.isAndroid() returns true.

Minimal yet complete reproducer code (or URL to code)

@GrabResolver(name='google', root='https://maven.google.com')
@Grapes([
    @Grab(group='io.netty', module='netty-common', version='4.1.11.Final'),
    @Grab(group='com.google.android', module='android', version='+'),
])
import io.netty.util.internal.PlatformDependent

ClassLoader.scl = this.class.classLoader

assert PlatformDependent.isAndroid() == false

Netty version

Any, including the latest 4.1.19.Final

JVM version (e.g. java -version)

Any Desktop JVM

OS version (e.g. uname -a)

Any

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Feb 9, 2018
0reactions
normanmaurercommented, Feb 2, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexplained Windows or software behavior may be caused ...
Resolution. To resolve this problem, try to identify and remove deceptive software from your computer. To do this, use one or all the...
Read more >
How to Fix Android Apps Not Working on Windows 11
Android apps could break on your Windows 11 PC for many reasons. Here's a guide to help you fix most of these issues....
Read more >
Detection and Visualization of Android Malware Behavior
This work focuses on monitoring Android applications' suspicious behavior at ... problem of understanding the Android application behavior in several ways.
Read more >
Why is Android Studio still such a gruesome embarrassment?
One problem, of course, is that Android Studio was not built from scratch; it's based on the long-in-the-tooth IntelliJ IDEA platform, ...
Read more >
Android studio isn't opening on Windows - Stack Overflow
Open Start menu > computer > System Properties > Advanced System Properties In the Advanced tab > Environment Variables, add new system variable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found