please I have a problem. I added GoogleAdsMob in my application but it doesn't appear anywhere. I used the code below, but so far nothing. Nevertheless it counts on the Google AdsMob side but nothing appears in my App. Does anyone have a solution?
import GoogleMobileAds
import UIKit
class ViewController: UIViewController, GADBannerViewDelegate {
/// The AdManager banner view.
@IBOutlet weak var bannerView: GAMBannerView!
override func viewDidLoad() {
super.viewDidLoad()
print("Google Mobile Ads SDK version: \(GADMobileAds.sharedInstance().sdkVersion)")
bannerView.adUnitID = "/6499/example/banner"
bannerView.rootViewController = self
bannerView.load(GAMRequest())
}
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
Post
Replies
Boosts
Views
Activity
Hello !
Has anyone here had this kind of error please? I put my file in the cloud then uploaded and then this error appeared.
I saw this on Stack but I can't apply it to my project, in fact I don't understand.
Initially it worked but I put it in Google Drive and then removed it. I took the project of a friend, modified it and it gave me this application.
The only problem is that it doesn't compile anymore, whereas before I put it in the Drive it compiled normally.
Showing Recent Messages
Could not determine generated file paths for Core Data code generation: The command `(cd '/Users/gastonteku/Downloads/App Final Work/My-Book-with-Widget-and-Search' && /Users/gastonteku/Documents/Xcode.app/Contents/Developer/usr/bin/momc --dry-run --action generate --swift-version 5.0 --sdkroot /Users/gastonteku/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk --iphonesimulator-deployment-target 14.0 --module Sur_les_Ailes_de_la_Foi '/Users/gastonteku/Downloads/App Final Work/My-Book-with-Widget-and-Search/MyBookDataModel.xcdatamodeld' '/Users/gastonteku/Library/Developer/Xcode/DerivedData/Sur_les_Ailes_de_la_Foi-ebjletqfnvziddcmkhqszjlfsyep/Build/Intermediates.noindex/Sur les Ailes de la Foi.build/Debug-iphonesimulator/Sur les Ailes de la Foi.build/DerivedSources/CoreDataGenerated/MyBookDataModel')` exited with status 1. The command's output was:
/Users/gastonteku/Downloads/App Final Work/My-Book-with-Widget-and-Search/MyBookDataModel.xcdatamodeld:: error: Could not fetch generated file paths: Error, failed to read Core Data data model from /Users/gastonteku/Downloads/App Final Work/My-Book-with-Widget-and-Search/MyBookDataModel.xcdatamodeld/MyBookDataModel.xcdatamodel: unknown model format [0]
that's my error code
I uploaded my project on Google Drive, now it doesn't compile anymore
Hello to all, I hope you are well. I code on a virtual machine (remote use) and I had to put the project in my Google Drive. I downloaded it earlier and I try to compile the file but it shows me these two errors. I read this solution on stack overflow( https://stackoverflow.com/questions/41545658/could-not-determine-generated-file-paths-for-coredata-code-generation )
but I really don't understand it, I'm a beginner, can someone help me please?
and I don't know why it tells me that it can't find 'Google Mobile Ads' when I installed it earlier. Please I need help urgently. The application should be ready this Friday.
Time of my launchscreen is too long since I changed my json file
Here, I created with a friend a book application and he initially put a json file in the program. Normally when I compile the file, everything is fine, but when I change the file to put the file that should be put (a file of more than 3000 lines) the application blocks at the LauchingScreen. I checked that my Json file is correct and yes it is correct, when I put back the old json file it compiles but when I put the new json file it doesn't compile anymore. Since 3 days I'm looking for a solution but nothing. Could someone here help me please?
Previously it compiled well with the second one but due to a problem I had to delete the application and create a new one I don't know why it doesn't compile anymore this time.
the home screen takes more than 5 minutes to appear and I don't know how to fix it.
Here are the links of the two json files:
Old ( the one on which the application compiles ): https://drive.google.com/file/d/1E3-pAy5-ShvGO__adsfNcq1OpLwM8nEu/view?usp=sharing
New ( the one that does not compile ): https://drive.google.com/file/d/1E3-pAy5-ShvGO__adsfNcq1OpLwM8nEu/view?usp=sharing
Hi everyone! Here I have a new problem:
My application compiles but unfortunately, I can't open the files contained in the json file. My indexViewController file doesn't display it.
Here is the link of my json file: https://drive.google.com/file/d/1qMKLNcf1fvYla21Yhh_D36FuPI-0-kj2/view?usp=drivesdk
and my Index file : https://drive.google.com/file/d/169H5w6WvqAE43B4VceXqvSrHJXJUzE8Y/view?usp=sharing
and here is the code of my indexviewcontroller :
@IBOutlet weak var indexTableView: UITableView!
@IBOutlet weak var bookmarkButton: UIBarButtonItem!
// The BookViewModel init method decodes the json file and sets the chapters property on this instance
var book: BookViewModel = BookViewModel()
var chapters: [ChapterViewModel] = [ChapterViewModel]()
var managedObjectContext: NSManagedObjectContext!
var hasUserTappedOnBookmarkWidget: Bool = false
let searchController = UISearchController(searchResultsController: nil)
var filteredChapters: [ChapterViewModel] = [ChapterViewModel]()
var chapNumberAndSearchTextRangeList: [Int: [ChapterViewModel]] = [Int: [ChapterViewModel]]()
var searching = false
lazy var workItem = WorkItem()
private var userClickedChapter: ChapterViewModel?
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
chapters = book.chapters
setNavBarLargeTitleProperty()
// This makes the table view row animate its selection state as it pops and pushes on the navigation stack.
if let selectedIndex = indexTableView.indexPathForSelectedRow {
let coordinator = self.transitionCoordinator
if coordinator != nil {
coordinator?.animate(alongsideTransition: { (context) in
self.indexTableView.deselectRow(at: selectedIndex, animated: true)
}, completion: { (context) in
if context.isCancelled {
self.indexTableView.selectRow(at: selectedIndex, animated: false, scrollPosition: .none)
} else {
self.indexTableView.deselectRow(at: selectedIndex, animated: true)
}
})
} else {
self.indexTableView.deselectRow(at: selectedIndex, animated: true)
}
}
// if the user has tapped on the widget, navigate to BookmarkViewController directly
if hasUserTappedOnBookmarkWidget {
performSegue(withIdentifier: "goToBookmarks", sender: self)
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Set the datasource and delegate as self
indexTableView.dataSource = self
indexTableView.delegate = self
indexTableView.register(UINib(nibName: "IndexCell", bundle: nil), forCellReuseIdentifier: "customIndexCell")
Hello, please, can anyone help me? I have been trying to compile this code for days but I get the same error: fatal error unexpectedly found nil while unwrapping an optional value xcode.
I have already read many of your answers without success, could someone explain to me why it acts like this and how to remedy it?
at the level of the for loop
Thanks you so much
struct BookViewModel {
var chapters: [ChapterViewModel] = [ChapterViewModel]()
init() {
let model = Bundle.main.decode(BookModel.self, from: "Book-v1.json")
for chapter in model!.chapters {
let chapterVM = ChapterViewModel(number: chapter.number, name: chapter.name, contents : chapter.contents)
self.chapters.append(chapterVM)
}
}
}
struct ChapterViewModel {
var number: Int = 0
var name: String = ""
var contents: NSAttributedString = NSAttributedString(string: "")
var textRangeLocation: Int = 0
var textRangeLength: Int = 0
var searchedNameWithText: NSAttributedString = NSAttributedString(string: "")
init(number : Int, name: String, contents : String) {
self.name = name
self.number = number
self.contents = convertToAttibutedText(contentsInStringFormat: contents)
}
}
struct BookModel: Codable {
var name: String = ""
var chapters: [ChapterModel] = [ChapterModel]()
class ChapterModel: Codable {
var number: Int = 0
var name: String = ""
var contents: String = ""
}
}