将下载下来的 SDK 压缩包内的 open_ad_sdk.aar 复制到应用的lib文件夹(没有的话须手动创建)
找到工程中的build.gradle文件,在dependencies语句块中加入:
implementation(name: 'open_ad_sdk', ext: 'aar') implementation "com.android.support:appcompat-v7:26.0.0" implementation "com.android.support:recyclerview-v7:26.0.0" implementation 'de.hdodenhof:circleimageview:2.1.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
然后添加repositories块在dependencies上面
repositories { flatDir { dirs 'lib' } }
然后添加ndk块在android的defaultConfig中,设置支持的 SO 库构架:
ndk { // 设置支持的 SO 库构架,注意这里要根据你的实际情况来设置 abiFilters //‘armeabi-v7a’, ‘arm64-v8a’, ‘x86’, ‘x86_64’, ‘arm64-v8a’ abiFilters 'armeabi-v7a' }
设置一下gradle.properties中的sdk版本,然后按Alt+Enter同步Gradle文件引用库
# Android SDK version that will be used as the compile project PROP_COMPILE_SDK_VERSION=26 # Android SDK version that will be used as the earliest version of android this application can run on PROP_MIN_SDK_VERSION=19 # Android SDK version that will be used as the latest versio