cocos2.3.4穿山甲接入指引

  1. proj.android-studio/build.gradle
    repositories {
        maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
        maven { url 'https://maven.google.com/' }
    }

allprojects {
    repositories {
        maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
        maven { url 'https://maven.google.com/' }
        flatDir {
            dirs 'libs'
        }
    }
}
  1. proj.android-studio\app\build.gradle
    minifyEnabled false//true开启混淆配置,false关闭
    shrinkResources false//跟资源有关,false就对了

allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}

implementation fileTree(dir: 'libs', include: ['*.jar'])//这里一定要去掉aar 否则会库冲突

implementation 'com.android.support:support-v4:24.2.0'
//穿山甲
implementation(name: "open_ad_sdk", ext: 'aar')
  1. proj.android-studio\app\AndroidManifest.xml 注释掉的是和cocos2.3.4版本重复权限











    android:name="org.cocos2dx.javascript.GameApplication"

     
         
     
    
     
    

  2. 拷贝sdk libs到app目录


    image.png
  3. 拷贝res到图标同级目录


    image.png
  1. proj.android-studio\app\proguard-rules.pro
    底部添加
    -keep class com.bytedance.sdk.openadsdk.** { ; }
    -keep public interface com.bytedance.sdk.openadsdk.downloadnew.
    * {;}
    -keep class com.pgl.sys.ces.
    {;}
    -keep class com.xtc.watch.view.account.login.utils.stroke.bean.
    * {*;}

  2. 拷贝GameApplication.java到AppActivity.java同级目录

  3. AppActivity参考自己的文件

  4. 打包一定记得是不要选ins。。。

你可能感兴趣的:(cocos2.3.4穿山甲接入指引)