自从我升级到PlayServices 8.1.0后,我收到了多个错误。标记管理器类移动到另一个/新依赖项?
我找不到此错误的引用:
Error:(27, 40) Gradle: error: package com.google.android.gms.tagmanager does not exist
Error:(90, 12) Gradle: error: cannot find symbol class TagManager
Error:(456, 41) Gradle: error: cannot find symbol class ContainerHolder
答案 0 :(得分:3)
var interAd = ADInterstitialAd()
var interAdView:UIView = UIView()
var closeButton = UIButton.buttonWithType(UIButtonType.System) as! UIButton
override func viewDidLoad() {
super.viewDidLoad()
closeButton.frame = CGRectMake(10, 10, 20, 20)
closeButton.layer.cornerRadius = 10
closeButton.setTitle("X", forState: .Normal)
closeButton.setTitleColor(UIColor.blackColor(), forState: .Normal)
closeButton.backgroundColor = UIColor.whiteColor()
closeButton.layer.borderColor = UIColor.blackColor().CGColor
closeButton.layer.borderWidth = 1
closeButton.addTarget(self, action: "close:", forControlEvents: UIControlEvents.TouchDown)
}
func close(sender: UIButton) {
closeButton.removeFromSuperview()
interAdView.removeFromSuperview()
}
func loadAd() {
println("load Ad")
interAd = ADInterstitialAd()
interAd.delegate = self
}
func interstitialAdDidLoad(interstitialAd: ADInterstitialAd!) {
println("ad did load")
interAdView = UIView()
interAdView.frame = self.view.bounds
view.addSubview(interAdView)
interAd.presentInView(interAdView)
UIViewController.prepareInterstitialAds()
interAdView.addSubview(closeButton)
}
func interstitialAdDidUnload(interstitialAd: ADInterstitialAd!) {
println("ad did not load")
}
func interstitialAd(interstitialAd: ADInterstitialAd!, didFailWithError error: NSError!) {
println("failed to recieve")
println(error.localizedDescription)
closeButton.removeFromSuperview()
interAdView.removeFromSuperview()
}
@IBAction func ShowAds(sender: UIButton) {
loadAd()
}
具有上述依赖性,我仍然可以获得dependencies{
compile 'com.google.android.gms:play-services-analytics:8.1.0'
}
类。