I am trying to integrate Chartboost for my android project.
I download Unreal Engine-4.10 from github few days ago.
I have added the chartboost.jar, code with the android ad banner implementation as a reference, and extra settings for <activity> section, in the package settings.
I have built the following configurations with Visual studio 2013: Development Editor - Win 64, Development - Android, Shipping - Android. Everything compiled without errors.
I can see the blueprint node to show an interstitial Chartboost Ad in the editor and i have packaged a development android example.I tested in a device and from the Chartboost dashboard i see confirmation that chartboost was integrated, although i didn’t see any test ads in the device. Still might need to check some things in the code, manifest file or in the dashboard settings.
The thing is when i try to build a shipping configuration, i got an build error, probably something to do with proguard.
At Chartboost Android SDK Guide there is the following step:
If you plan to use Proguard, add the following to your proguard.cfg (also make sure you follow Proguard instructions for the Google Play Services library):
-keep class com.chartboost.** { *; }
How can we change the proguard settings and manifest file for version 4.10?
For 4.10 there is now support to add entries to proguard. Add a ProguardAdditions.txt file to your project’s Build/Android directory with any additions you want.
I just tried it and I see the com.chartboost.** added to my project’s Intermediate/Android/APK/proguard-project.txt before -keep class com.oculus.**. Try deleting the proguard-project.txt in this directory and packaging again so it regenerates it if you don’t see this.
The targetSdkVersion setting in the Android Project Settings is only used to set the AndroidManifest.xml value so you can try setting it to 23, but it will still use the setting in Android SDK for the SDK platform version. Setting this value to android-23 will not work, though, due to a depreciated API issue in Google’s APK expansion library; they removed it android-23.
I gave it another try today. First removed any code related with Chartboost and the chartboost.jar form the C:\UnrealEngine-4.10\Engine\Build\Android\Java\libs directory. Then, i have built again the Shipping-Android configuration and could build a shipping configuration for my game. Just to make sure the build from source was working in shipping configuration without tweaking the source code. Then i added the chartboost.jar to the C:\UnrealEngine-4.10\Engine\Build\Android\Java\libs directory, without adding any code, and tried to package again a shipping build for the game, but the same error occurred.
After that, i have deleted the chartboost.jar and replace it with one from an older SDK version. Finally i could package a shipping build. Although the sdk is pretty old. I have contacted Chartboost Support team, if there is any archive with older SDKs. Hoping to find the last one before the SDK 6.0.2 release.
If they contact me, i will try again to implement the SDK and will update the thread.
I had the same error in UE 4.7.6 after adding chartboost.jar v6.1.0:
MainFrameActions: Packaging (Android (ETC1)): [proguard] Warning: com.chartboost.sdk.c: can't find referenced method 'int checkSelfPermission(java.lang.String)' in class android.app.Activity
MainFrameActions: Packaging (Android (ETC1)): [proguard] You should check if you need to specify additional program jars.
MainFrameActions: Packaging (Android (ETC1)): [proguard] Warning: there were 1 unresolved references to program class members.
MainFrameActions: Packaging (Android (ETC1)): [proguard] Your input classes appear to be inconsistent.
MainFrameActions: Packaging (Android (ETC1)): [proguard] You may need to recompile them and try again.
MainFrameActions: Packaging (Android (ETC1)): [proguard] Alternatively, you may have to specify the option
MainFrameActions: Packaging (Android (ETC1)): [proguard] '-dontskipnonpubliclibraryclassmembers'.
I fixed this by adding these two lines to my Engine\Build\Android\Java\proguard-project.txt:
-keep class com.chartboost.** { *; }
-dontwarn android.app.Activity
The second line makes the error go away and the app runs fine on a shipping build but it looks more like a work-around than an actual fix…