美文网首页
cocos2.3.4穿山甲接入指引

cocos2.3.4穿山甲接入指引

作者: 人气小哥 | 来源:发表于2020-10-13 10:52 被阅读0次
  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版本重复权限



    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
    <uses-permission android:name="android.permission.GET_TASKS"/>



    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


    <uses-permission android:name="android.permission.WAKE_LOCK" />

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

     <provider
         android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
         android:authorities="${applicationId}.TTFileProvider"
         android:exported="false"
         android:grantUriPermissions="true">
         <meta-data
             android:name="android.support.FILE_PROVIDER_PATHS"
             android:resource="@xml/file_paths" />
     </provider>
    
     <provider
         android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
         android:authorities="${applicationId}.TTMultiProvider"
         android:exported="false"
         />
    

    </application>

  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穿山甲接入指引

      本文链接:https://www.haomeiwen.com/subject/ifzmpktx.html