felHR85 / UsbSerial

Usb serial controller for Android
MIT License
1.8k stars 585 forks source link

Just implementing it to build gradle invoke error #235

Closed kotran88 closed 5 years ago

kotran88 commented 5 years ago

I added maven { url 'https://jitpack.io' } and on build.gradle(app module) on dependency . I added implementation 'com.github.felHR85:UsbSerial:6.0.5'

When I build project to real device, it invoke error as below

build failed 41s 578ms
Run build 41s 328ms
Load build 5ms
Configure build 1s 642ms
Calculate task graph 66ms
Run tasks 39s 599ms
null  
Invoke-customs are only supported starting with Android O (--min-api 26)  
Stripped invalid locals information from 1 method.  
null  
com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/jpd/.gradle/caches/transforms-1/files-1.1/UsbSerial-6.0.5.aar/d7d4b2e76bc8403376feccc049587b9f/jars/classes.jar  
com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.  
com.android.tools.r8.CompilationFailedException: Compilation failed to complete  
com.android.tools.r8.utils.AbortException  
felHR85 commented 5 years ago

Add this to your gradle, in the android section:

  compileOptions {
        encoding "UTF-8"
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }