Android Studio 3.3.2运行OSChina4.1.7

一: build.gradle
1.

    repositories {
        jcenter()
    }

>>

    repositories {
        google()
        jcenter()
    }

2. 

    dependencies {
        //noinspection GradleDependency
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.3.0'
    }

>>

    dependencies {
        //noinspection GradleDependency
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.4'
    }

3.

allprojects {
    repositories {
        jcenter()
		....

>>

allprojects {
    repositories {
        google()
        maven {
            url 'https://maven.google.com'
        }
		...	

二:app/build.gradle
1. 

    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            output.outputFile = new File(
                    output.outputFile.parent + "/${variant.buildType.name}",
                    "osc-android-${variant.versionName}-${variant.productFlavors[0].name}.apk".toLowerCase())
        }
    }

>>

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            def outputFile = output.outputFile
            def fileName
            if (outputFile != null && outputFile.name.endsWith('.apk')) {
                if (variant.buildType.name.equals('release')) {
                    fileName = "osc-android_release_v${defaultConfig.versionName}.apk"
                } else if (variant.buildType.name.equals('debug')) {
                    fileName = "osc-android_debug_v${defaultConfig.versionName}.apk"
                }
                outputFileName = fileName
            }
        }
    }

2. compile -》 implementation
3. testCompile -》 testImplementation 
4. androidTestCompile -》 androidTestImplementation
5. defaultconfig标签下增加
        flavorDimensions "default"
        //解决Annotation processors must be explicitly declared now问题--20181019
        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
6. 

        ndk {
            //设置支持的SO库架构
            abiFilters 'armeabi' //, 'arm64-v7a', 'x86' , 'x86_64','arm64-v8a',
        }

>>

		ndk {
            //设置支持的SO库架构
            //abiFilters 'armeabi' //, 'arm64-v7a', 'x86' , 'x86_64','arm64-v8a',
			abiFilters 'x86', 'x86_64', 'armeabi-v7a','arm64-v8a'
        }


三: open/build.gradle
1. 

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'
    })
    testCompile 'junit:junit:4.12'
    compile "com.android.support:support-v4:$rootProject.ext.supportVersion"
    
    compile files('libs/open_sdk_r5781.jar')
}

>>

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testImplementation 'junit:junit:4.12'
    implementation "com.android.support:support-v4:$rootProject.ext.supportVersion"
    
    api files('libs/open_sdk_r5781.jar')
}

四:app/src/main/res/values/theme.xml