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.

Necessity to compile for VERSION_1_8

See original GitHub issue

It might be worth adding to the instructions to use this, the need for adding

+    compileOptions {
+        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_1_8
+    }

to the gradle files for all the modules that include this. I was getting a fairly cryptic error code com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26) that I eventually tracked down to this. Alternatively, I’m not sure how necessary the lambda expression in BleManager is since without that this restriction might not be required.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
philips77commented, Nov 28, 2019

Whaaaaat? No one reads readme?! I’ll rename it to Pleasereadme or Youdbetterreadme 😉

PS. Ok, I’ll put it higher in the TL;DR section.

0reactions
stanleyguevaracommented, Nov 28, 2019

I think it’s still worth mentioning somewhere in the readme.

I’ve bumped into it on latest Android Studio (3.5.2 on Win10) with fresh project straight from the wizard (though AS install is pretty old, maybe it has default somewhere to not use 1.8, IDK).

Simply adding the library to gradle.build was causing quite cryptic crash: ClassNotFoundException: Didn't find class "com.test.MainActivity" on path: DexPathList

Took a while to discover it was the lib in first place, as it wasn’t crashing on API 28, only few commits later when running on API 26 it started crashing…

Edit: Now I see it’s a last point in readme under Changes in version 2.0, super easy to miss. It’d really be better if it would be more like “Remember to add”:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

placed directly under implementation 'no.nordicsemi.android:ble:2.1.1', as I’m pretty sure no one reads the whole readme 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I compile a .java with support for older versions of Java?
Yes, you can set the version of compiler at compile time. And compile your java code into old versions of java.
Read more >
Setting the -source and -target of the Java Compiler
Sometimes when you may need to compile a certain project to a different version than what you are currently using. The javac can...
Read more >
javac - Java programming language compiler
DESCRIPTION. The javac tool reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files. It ......
Read more >
Meaning of common message when install a package "There ...
When installing packages, the message There are binary versions available but ... Do you want to install from sources the package which needs...
Read more >
Go 1.18 Release Notes - The Go Programming Language
As a result of this change, (possibly incorrect) programs may not compile anymore. The necessary fix is straightforward: fix the program if it...
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