Search code examples
androidandroid-studiomopubmillennial-media

mopub android studio millennialmedia unresolved


I am trying to add MoPub adds, I use Android Studio. I tried to apply the instructions here:

https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started

I couldn't apply them after title "Adding as Compiled .aar" I guess.

All seems to be fine in the project but I am getting unused import and symbol cannot be resolved errors all over in the files "MillennialInterstitial" "MillennialBanner" in folder mop-sdk/java/mobileads/util

I tried to import the jar of millennial media manually, I signed up and downloaded the resources from here:

http://docs.millennialmedia.com/android-SDK/

Many thanks in advance

I guess I couldn't succeed that either. Here is a copy of my errors, if it could be of any help.

Error:(7, 35) error: package com.millennialmedia.android does not exist
Error:(8, 35) error: package com.millennialmedia.android does not exist
Error:(9, 35) error: package com.millennialmedia.android does not exist
Error:(10, 35) error: package com.millennialmedia.android does not exist
Error:(11, 35) error: package com.millennialmedia.android does not exist
Error:(12, 35) error: package com.millennialmedia.android does not exist
Error:(23, 13) error: cannot find symbol class MMAdView
Error:(122, 5) error: cannot find symbol class MMAdView
Error:(87, 54) error: cannot find symbol class RequestListener
Error:(89, 47) error: cannot find symbol class MMAd
Error:(95, 45) error: cannot find symbol class MMAd
Error:(101, 48) error: cannot find symbol class MMAd
Error:(104, 44) error: cannot find symbol class MMAd
Error:(110, 41) error: cannot find symbol class MMAd
Error:(110, 58) error: cannot find symbol class MMException
Error:(116, 39) error: cannot find symbol class MMAd
Error:(47, 9) error: cannot find symbol variable MMSDK
Error:(49, 33) error: cannot find symbol class MMAdView
Error:(58, 13) error: cannot find symbol variable MMRequest
Error:(61, 44) error: cannot find symbol class MMRequest
Error:(62, 33) error: cannot find symbol variable MMSDK
Error:(88, 9) error: method does not override or implement a method from a supertype
Error:(94, 9) error: method does not override or implement a method from a supertype
Error:(100, 9) error: method does not override or implement a method from a supertype
Error:(103, 9) error: method does not override or implement a method from a supertype
Error:(109, 9) error: method does not override or implement a method from a supertype
Error:(115, 9) error: method does not override or implement a method from a supertype
/Users/ugur/AndroidStudioProjects/xxx/mopub-sdk/src/main/java/com/mopub/mobileads/MillennialInterstitial.java
Error:(7, 35) error: package com.millennialmedia.android does not exist
Error:(8, 35) error: package com.millennialmedia.android does not exist
Error:(9, 35) error: package com.millennialmedia.android does not exist
Error:(10, 35) error: package com.millennialmedia.android does not exist
Error:(11, 35) error: package com.millennialmedia.android does not exist
Error:(12, 35) error: package com.millennialmedia.android does not exist
Error:(24, 13) error: cannot find symbol class MMInterstitial
Error:(77, 60) error: cannot find symbol class RequestListener
Error:(79, 47) error: cannot find symbol class MMAd
Error:(85, 45) error: cannot find symbol class MMAd
Error:(90, 58) error: cannot find symbol class MMAd
Error:(93, 44) error: cannot find symbol class MMAd
Error:(104, 41) error: cannot find symbol class MMAd
Error:(104, 58) error: cannot find symbol class MMException
Error:(118, 39) error: cannot find symbol class MMAd
Error:(41, 9) error: cannot find symbol variable MMSDK
Error:(45, 13) error: cannot find symbol variable MMRequest
Error:(48, 39) error: cannot find symbol class MMInterstitial
Error:(50, 50) error: cannot find symbol class MMRequest
Error:(78, 9) error: method does not override or implement a method from a supertype
Error:(84, 9) error: method does not override or implement a method from a supertype
Error:(90, 9) error: method does not override or implement a method from a supertype
Error:(92, 9) error: method does not override or implement a method from a supertype
Error:(103, 9) error: method does not override or implement a method from a supertype
Error:(107, 39) error: cannot find symbol variable MMException
Error:(117, 9) error: method does not override or implement a method from a supertype
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Error:Execution failed for task ':mopub-sdk:compileReleaseJava'.
> Compilation failed; see the compiler error output for details.

Solution

  • I figured out the problem:

    I was using the "Full SDK" of the MoPub which I did not actually need. When I used "Base SDK" instead in this link again:

    https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started

    things worked out perfectly carrying out the steps in this post

    Android Studio won't let me import SDK

    I hope I can save another person a weekend :)