我无法在Qt Android应用程序Java文件中导入com.onesignal.OneSignal,出现错误:包com.onesignal不存在
我想这足以使导入工作正常。
顺便说一句,如果我将OneSignal添加为远程二进制依赖项,则 compile'com.onesignal:OneSignal:[3.9.1,3.99.99]'导入效果很好。
整个build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:[26.0.0, 27.2.0]'
compile 'com.android.support:customtabs:[26.0.0, 27.2.0]'
compile 'com.android.support:cardview-v7:[26.0.0, 27.2.0]'
compile 'com.google.android.gms:play-services-location:[10.2.1, 12.1.0]'
compile 'com.google.android.gms:play-services-base:[10.2.1, 12.1.0]'
compile 'com.google.firebase:firebase-messaging:[10.2.1, 12.1.0]'
compile files('libs/onesignal-sources.jar')
//compile 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
}
android {
/*******************************************************
* The following variables:
* - androidBuildToolsVersion,
* - androidCompileSdkVersion
* - qt5AndroidDir - holds the path to qt android files
* needed to build any Qt application
* on Android.
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qt5AndroidDir + '/res', 'res']
resources.srcDirs = ['src']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "app id"
manifestPlaceholders = [
onesignal_app_id: "onesignal app id",
onesignal_google_project_number: "REMOTE"
]
}
}