- 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'
}
}
}
- 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')
-
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>
-
拷贝sdk libs到app目录
image.png -
拷贝res到图标同级目录
image.png
-
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.* {*;} -
拷贝GameApplication.java到AppActivity.java同级目录
-
AppActivity参考自己的文件
-
打包一定记得是不要选ins。。。
网友评论