Can't build android mopub-sdk 3.10.0


#1

I am trying to integrate mopub-sdk into our project.
As source:
I’m getting gradle error :

"unable to find projectinternal.getPluginManager"

As aar:
./gradlew mopub-sdk:build fails with :
4 errors
:mopub-sdk:compileDebugJava FAILED
FAILURE: Build failed with an exception.
Also we are using fabric for crashlytics, seems like there is an easy way for IOS but not Android.
As source I am wondering this is a gradle version related issue.
As aar build, apparenty this sdk build with JDK7 and I am working on Java 1.6.0_65 and not willing to update it. At this point, not sure how can I complete integration.


#2

Hello Yapraka,

We recommend that you install JDK7 and set the path for java_home as JDK 7 to use the aar.

For the source build, I cannot find any reference to projectinternal or getPluginManager in our SDK. Looking up projectinternal leads me to [projectinternal.java][1] which is part of the gradle master.

What version of gradle are you using?

The version should be included in your project’s top level build.gradle dependencies.

e.g.(

 classpath 'com.android.tools.build:gradle:1.2.3'

)

The issue seems to be a gradle version related issue.

Let us know the details so that we may further assist.

Thanks!
[1]: https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/project/ProjectInternal.java


#3

Thanks for your reply ekinbenho,

I updated jdk to 7 but in output directory there are two aar files created : mopub-sdk-debug.aar and mopub-sdk-release.aar. Which one I should be using?

  • Thanks

#4

Hello Yapraka,

Please use the release build in your application when releasing your app. The build file configures the release version to use ProGuard while the debug version is not configured to use it. Please see Android’s documentation on “buildTypes” here.

The buildTypes element controls how to build and package your app. By default, the build system defines two build types: debug and release. The debug build type includes debugging symbols and is signed with the debug key. The release build type is not signed by default. In this example the build file configures the release version to use ProGuard.

Let us know if you have any further questions.

Thanks!


#5

Hello ekinbenho,

I successfully integrated mopub-sdk 3.10.0, but when I try to use MoPubInterstitial I get this error:

java.lang.NoClassDefFoundError: com.mopub.mobileads.AdViewController$1
        at com.mopub.mobileads.AdViewController.<init>(AdViewController.java:112)

Could you tell me what is going wrong?

Thanks again.


#6

Hi,

I solved NoClassDefFounfException by adding mopub-volley jar in dependencies, but I still do not have success on seeing interstitial ads on live. I am getting these errors :

  • FailedAd unit is warming up. Try again in a few minutes.
    and
  • Unspecified error. (mCurrentInterstitialState = NOT_READY)

What is going wrong?


#7

Anyone had this problems?

FATAL EXCEPTION: Thread-4056
java.lang.NoSuchFieldError: com.mopub.volley.NetworkResponse.networkTimeMs
at com.mopub.network.AdRequest.logScribeEvent(AdRequest.java:288)
at com.mopub.network.AdRequest.parseNetworkResponse(AdRequest.java:221)
at com.mopub.volley.NetworkDispatcher.run(NetworkDispatcher.java:121)

OR

when I try to use the key(ID) provided from Mopub Sample App

I/MoPub﹕ Ad failed to load.
MopubAd unit is warming up. Try again in a few minutes.