androidstudio 使用YoukuOpenPlaySdk

写一下省的又忘记了~~~


1、eclipse 导出sdk为studio所用


2、删除studio无用文件  /bin, /gen等~~~


3、替换fastjson为最新版本~~~~不知道为什么~~~eclipse  ok~~~studio出错~~~


4、修改build.gradle 修改buildscript,sourceSets等, 示例


buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0+'
    }
}
apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:21.0.3'
    compile files('libs/baseproject.jar')
    compile files('libs/mAppTracker.jar')
    compile files('libs/playerBase.jar')
    compile files('libs/tracking.jar')
    compile files('libs/YoukuAnalytics.jar')
    compile files('libs/fastjson-1.2.4.jar')
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}



5、删除AndroidManifest没必要的文件


6、哦,三个9.png文件在studio会出错,需要替换, 具体错误编译的时候可以看到




6、其余按文档做基本ok了~~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值