嗨,我正在尝试在 android 中使用OneSignal,我正在按照本教程在 Android Studio 中安装 SDK。这里
我能够编译依赖项并同步 gradle 文件。但是当我想导入com.onesignal.OneSignal;
它时说:无法解析符号!
这是我在 app.gradle 文件中的依赖项
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.onesignal:OneSignal:1.10.+@aar'
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.google.android.gms:play-services-analytics:+'
compile project(':gson-2.2.2')
compile project(':java_websocket')
compile project(':signalr-client-sdk')
compile project(':signalr-client-sdk-android')
}
我做的事情:
1. File > Synchronize
2. File > Invalidate Cashes and Restart
更新:
我在一个新项目中做了这些步骤,没关系!为什么我不能在这个特定的项目中做到这一点?
编辑:
整个 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "ir.irsapardaz.sina.gamev01"
manifestPlaceholders = [manifestApplicationId:"${applicationId}"]
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.onesignal:OneSignal:1.10.+@aar'
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.google.android.gms:play-services-analytics:+'
compile project(':gson-2.2.2')
compile project(':java_websocket')
compile project(':signalr-client-sdk')
compile project(':signalr-client-sdk-android')
}