kongqw / AndroidSerialPort

Android串口通信示例
718 stars 214 forks source link

找不到包名 #3

Closed supermoutant closed 6 years ago

supermoutant commented 6 years ago

import com.kongqw.serialportlibrary.listener.OnOpenSerialPortListener; import com.kongqw.serialportlibrary.listener.OnSerialPortDataListener; import com.kongqw.serialportlibrary.Device; import com.kongqw.serialportlibrary.SerialPortManager;

kongqw commented 6 years ago

如何导入的?用的库,还是通过gradle

supermoutant commented 6 years ago

@kongqw 用的库

kongqw commented 6 years ago

settings.gradle 文件里添加库了吗

supermoutant commented 6 years ago

@kongqw 添加了,我把项目删了,重回导入一次好了

kongqw commented 6 years ago

我看看你app下的 gradle 文件

supermoutant commented 6 years ago

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion '26.0.2' defaultConfig { applicationId "com.kongqw.serialport" minSdkVersion 19 targetSdkVersion 23 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile project(':SerialPortLibrary') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12'

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'

}

kongqw commented 6 years ago

这应该是你工程配置的问题而不是库的问题,不然不会库都找不到。 你可以尝试一下通过gradle导入