Eclipse/Android, MoPub with Admob Adapters - eclipse

I've been (unsuccessfully) attempting to add the AdMob Adapters to my MoPub integration for the past few days.
Specifically, what has been tripping me up is this quote on various MoPub support pages:
Copy the GooglePlayServicesBanner and GooglePlayServicesInterstitial classes into the com.mopub.mobileads package of your applicationā€™s src/ directory.
Now by 'your application' I would assume it to mean my actual project - not the mopub-sdk that it asked me to import.
However, my app doesn't have this com.mopub.mobileads, so I can't copy these files here. It made sense to me that maybe, I should be copying these 2 files into the mopub-sdk project that I imported as this does have com.mopub.mobileads. And I've just come across this page: which states:
The banner and interstitial adapters (e.g. GooglePlayServicesBanner.java and GooglePlayServicesInterstitial.java) should be placed in the com/mopub/mobileads folder in the MoPub SDK.
I realise the above is probably not meant for Elcipse, however....
Does anyone know where these adapters should actually go (when using Eclipse)?
Tried it
If I do copy them into the mopub-sdk project, I get errors because these 2 files reference Google Play Services and the mopub-sdk doesn't have the google-play-services.lib added as a library. My probject obviously does as I'm using it for Leaderboards/Google Ads.
There is no mention (that I can see) anywhere on any MoPub site about these errors and whether I should also add google-play-services-lib as a library to the mopub-sdk project in Eclipse.
What can I do (apart from also adding the google-play-services-lib as a library to the mopub-sdk project in Eclipse), to give Eclipse access to google-play-services.lib? Is there some trick to it?
Here are some screen shots to illustrate what I'm talking about:
^^ Is this the correct place for these files?^^
^^mopub-sdk libraries^^
^^my projects libraries^^

I would create the com.mopub.mobileads package in your app and copy the 2 Java files there.

Related

Header file not found for embedded framework inside library for React Native app

I'm currently working on a contract job where I've been asked to help integrate a 3rd party SDK with an existing React Native app. The SDK only comes in Android and iOS specific flavors, meaning that it has to be added on the platform-specific side of things (in my case, the iOS side with Xcode).
For the app, the client has created a react native module which gets built into a Library in Xcode, represented by a separate nested Xcode project in Libraries/MyLibrary.xcodeproj from the root of the base Xcode workspace project. This library has several method stubs defined in React Native which will need to be implemented in Swift (and likewise in Android), as this is in these methods that the 3rd party platform-specific SDK is utilized.
The issue I'm having has to do with accessing the 3rd party SDK framework in the library's existing bridging header file. I have followed every tutorial under the sun for how to integrate external frameworks with an existing Xcode project. This includes steps about adding the framework to the project, adding it under the Embedded Binaries and Linked Frameworks and Libraries sections of the project target, adding it under the Build Phases/Link Binary With Libraries section of both the project target and the library target, and adding the framework path under Project Settings/Framework Search Paths. From here, I add the appropriate import statement to my library's Library-Bridging-Header.h file with #import <MyFramework/MyFramework.h> so I can then access the framework in Swift. (This import statement is copied directly from the bridging header file of the sample project included with the SDK, so I know it is correct and should not be given in a different format such as quotes instead of angle brackets).
Regardless of following all of these steps multiple times over and in various combinations, I still get this error at build time: MyFramework/MyFramework.h file not found.
To clarify, MyFramework is just an alias for the actual 3rd party framework I'm attempting to integrate, and MyLibrary is an alias for the existing library with nothing but method stubs given to me by the client to implement in Swift.
Again, I have read every tutorial and forum under the sun, but none seem to address this very specific issue of integrating a 3rd party framework in a xcodeproj Library within the iOS version of a react native app. I would appreciate any new insights or suggestions anyone might have to offer! And please, please don't just post a link to or copy the steps from existing forum posts about a similar-sounding issue, as I've probably already read it šŸ˜‰. Understand that I think that there is something subtly unique about my specific circumstances which are causing these same steps from the 10+ articles that come up on the first page of Google and StackOverflow NOT to work.
Figured it out! I'll post my solution here in case anybody out there ever runs into the same issue as me.
TLDR - You must add the 3rd party framework in the root of the xcodeproj Library (NOT the top level project) AND ensure that the files were actually copied into that directory, not just referenced from the directory you copied the framework from (be sure to double-check in Finder, since checking the 'Copy if needed' box doesn't always work for some reason). Then, you must add $(PROJECT_DIR) to your xcodeproj Library's Build Settings/Framework Search Paths, and also drag and drop the framework from the root of your xcodeproj Library into the Library's Build Phases/Link Binary With Libraries panel.
I'll address some of the issues with other tutorials/forums that I found, with hopes that it might help someone else that finds themselves as frustrated as I was in this position.
Most only address adding the framework to the base level project, not the obscure case of a project within a project. Therefore, when you start following the steps, it can be confusing to know whether you should be changing the settings of the top-level project or the sub-project. Again, as I discovered, all changes should ONLY be made to the sub-project.
There are a few tutorials that do seem to address this situation regarding a project within a project, but the steps describe adding the framework to the top-level project under Embedded Binaries and Linked Frameworks and Libraries, but I believe the situation described in these tutorials are somehow subtly different than this situation here. Again, only mess with the sub-project.
There's a lot of discussion out there about "umbrella frameworks", but that doesn't really apply to this situation, and again, the terminology similarities can make it seem like it's a similar issue. As I understand it, "umbrella frameworks" are discouraged by Apple, but again, this situation is not the same.
Sorry for the long-winded explanation, but I'm hoping to provide the kind of detail I would have liked to have found when I was searching for solutions for this weirdly obscure problem.
Cheers!

About facebook unity plugin 4.3.3, how to add it in current project?

I upgrade facebook unity plugin from version 4.2.4 to 4.3.3 yesterday.
For the old version, I just add the jar file in project/plugin/Android and add some specific code to use it.
As for the new version, it just give me a whole facebook android project, what am I supposed to do with it?
Compile it to an jar and use it like before?
Export my project and also with FB project then package it in Eclipse?(which is super waste of time everytime)
In fact I tried both:
1 . this is not works anymore, result in some resource id errors.
2 . I did make out a package, but it can not login like it works before in 4.2.4.
Does anyone meet same problem like I did?
I really think A sdk should not give whole prject out, because as a running project, there is too much sdk to add in, we dont have to much time to deal with each plugin everytime. A big company like facebook should make things easier.
BTW: the instructions on Facebook page is old, I could not get useful information from them.
You should be able to just "Build and Run" with the new 4.3.3 version (if you imported the package and left the structure as is. Be sure to clear out the old Facebook SDK before you import this one.) Unity would automatically compile it in with your project.
To answer your questions on why we did this:
The reason why it got switch away from a jar is that in the older version when it was compiled to the jar, it meant the R class had hard-coded resource ids at compile time (of the jar). Unfortunately, when other plugins were introduced into a project, it reorders the resource ids but doesn't adjust the R class within the jar. This would break integration and make integrating Facebook with the other android plugins useless.
The source of the android files were packaged along with it because several developers requested more ways to edit the code to their needs. There's several android plugins for Unity out there and while we do our best to make sure our Unity SDK plays nice with them, there can be cases were a developer would like extra control on how they merge together.
With that said, since you upgraded your project from 4.2.4 to 4.3.3, did you follow the changelog here: https://developers.facebook.com/unity/change-log-4.x/#131013?
Basically what happened was that since importing a package doesn't let us delete old files, there was no way to clean up projects that used the jar method. Keeping them both in the project breaks the android build. This is only a one time migration that should happen again.

Making an app engine to use for similar app, but with different clients

Our team has made a big app. This app has been a success with previous client.
Now other clients will be using this app, but with added requirements and/or different needs.
I would like to focus on making the current app into a generic Engine so that we can maintain this engine up-to-date across those different client-apps.
How should I:
Tackle this?
Bearing in mind that some viewControllers will need to reflect for new client
Changing all the graphics across the app
Any hint of how I can achieve? Been googling since long, could not arrive at a decent solution.
I already did something similar in the past, here is how we did:
part 1A: create a template project using demo assets (images has to have a default names ex:background_home.png).
part 1B: make sure that "special texts" are loaded from a plist (example:[HOME_TITLE:"your title"]) in this way you will be able to load customizable texts from a plist in the app bundle programmatically.
part 2: ask your designer to make a special design for the client respecting the name used by the developers in the code (ex:part 1A => background_home.png) or ask your designer to generate more or less 20 themes.
part 3: make a MACOS app or a script which will copy the original project and replace demo assets and plist by the correct one in the original project. You want the script to generate an xcode project as you will need to double check with your developer team that the project is properly setted-up, build and deployment is much easier when you have an xcode project. In other words, the script just take the folder of the original project your team made and replace some file inside. So you won't struggle with xcode project architecture, you just replace defaults assets. Also remember that storyboard files or pbxproj are xml so you can parse and edit them, but you might have some headache doing this, that's why I recommand you to just modify the assets in the project folder.
Then you can compile that project, configure it with the provisioning you want and deploy it to your clients. Thats what we did when we needed and it worked like a charm. Basically we made a MACOS app that the sale's force could use directly with the client. They just had to send to the developer team the generated xcode project in a zip and we were in charge of the compilation and deployment. We "developed" more than 600 products using that trick.
PROBLEMS:
- The code was fully visible in the xcode project and anybody could read and/or steal it.
- The projects were very similar to each others as they came from the same source code, only the texts and assets were differents.
WORKAROUND-SOLUTIONS:
- You can imagine implementing crypto when saving the archive of a project, in this way only authorized personal can unzip the archive containing the source code.
- You can create multiple projects and do the same process with different types of project. In this way you can change the type of a generated project according to client wishes ...
Hope this help!

How to develop multiple Trigger.io plugins in a team?

Together with my team I'm developing multiple native plugins based on Trigger.io. Since the recent changes I'm not completely sure on the workflow and cannot find anything about it in the documentation either. Some questions that arise:
1) Should one set of inspector projects be used for all the plugins or should each plugin has its own set?
2) Which parts of the inspector projects should be maintained via version control, which should remain local? (fyi: we use SVN)
3) (Android) When using one inspector project for each plugin, whats the best way to import them all as Java projects in Eclipse? Note: each inspector project has 3 sub projects which have the same name across different plugins, so they'd have to renamed? Assuming I have 5 plugins in development, that'd mean that I have to import 15 Java projects into Eclipse. Is this really how it's meant to be?
The most effective way to develop plugins is still something we're working on, how things are right now is probably not as good as it could be (especially for developing multiple plugins), but as things are right now:
1) Each plugin should have its own set of inspector projects.
2) The majority of what the Toolkit puts in the plugins folder is probably best in version control. Things you can safely ignore are the .trigger folder and any bin, gen, or build folders in the inspector projects. If you are trying to keep less files in version control the things you definitely need are the assets/src folder in the ForgeInspector, and any of your own source in ForgeModule, the rest of the inspector project should be regenerated by the Toolkit.
3) I'd recommend using an eclipse workspace per plugin, as the Toolkit regenerates a lot of the code when you update the inspector I don't think it is currently possible to rename the projects.
I thought I'd include a quick overview of what the 3 projects are and why there are 3:
ForgeCore - This is the pre-build core library for Trigger.io apps, its used by both ForgeInspector and ForgeModule so it needs to be a separate project that can be referenced by both
ForgeInspector - This is meant to replicate as closely as possible how your plugin will actually be used, so is basically a stripped down Trigger.io app, its separate to ForgeModule so that you can see what code is in your plugin and what code needs to be put into build_steps.json so it will also be applied to a real Trigger.io app at build time.
ForgeModule - This contains your plugin code

Three20/Three20.h file not found for Archive

I'm trying to update an app that already have the Three20 library. Now i'm using xcode 4.5 and everytime i try to make an Archive i recive this error:
Three20/Three20.h file not found
At the beginning i wasn't able to make any kind of build,but after the adding of $(BUILT_PRODUCTS_DIR)/../three20 and $(BUILT_PRODUCTS_DIR)/../../three20 in the Header Search Path of the build and the target settings i can make a Build in my Device. Anyway if i try to made an Archive to publish my app, the same errors returns. What i can do? I have already reinstall the last version of Three20.... I have to try this solution that i found on internet:
Go to Xcode4 Preferences (Cmd + ,) > Locations > Build Location > and select ā€œPlace build products in locations specified by targetsā€
In xcode 4.5 i can't approach this solution...Maybe Build Location menĆ¹ is changed, i can't find the option ā€œPlace build products in locations specified by targetsā€ .... Someone knows where i can found this setting?
At least there's someone how have made successfully an Archive on Xcode4.5 and Three20?
I also support switching away from three20, but sometimes it's not that simple.
To resolve your issues, you can try to use CocoaPods. it's a library dependencies tool that let's you add any library you need. someone added a pod for three20 few weeks ago.
That should let you build your project using the standard xcode archive process.
If you don't feel like using cocoapods, you can also build that app using the "Build for..." -> "Archiving". you can find it in the same "Product" menu. it will generate a .app file that you can submit using the Application Loader app.
you can find the .app file by secondary clicking on the target name under the "Products" folder in your project sidebar.
I did the following to make it work for me:
for the three20 static library, I used cocoapods to include the files within the main project.. it just got rid of all the trouble three20 was giving me (and they are lots..) btw i tried replacing three20 with Nimbus.. but Nimbus was lacking on some of the features that my project was using three20 for.. so Nimbus wasn't helpful.
set skip install to yes under build settings for all other sub projects/static libraries and switched the copy headers from public to project under build phases
most importantly: under the sub libraries.. under build phases i ensured that copy files destination was changed from Absolute path to products directory.
and that was it!
hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:
Select the archive and click the Distribute button.
Select the 'Save Built Products' option.
Hit Next and Save.
Browse the created directory in Finder.
The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
in some cases usr/local/include will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory. but that directory (ie usr/local/include) varies depending on your sublibrary directory structure
Three20 has't update in long time.And it has many bugs.set up this framework is very hard.
you can try nimbus.It come from three20.
Nimbus' Background
Nimbus has been built with much inspiration from the Three20
framework. That being said, there are a number of fundamental problems
with Three20 that Nimbus works very hard to avoid. Among them:
Poor documentation. Spaghetti dependencies. Suffering from a "kitchen
sink" complex. A complex build structure. An enormous number of
difficult-to-solve bugs. Next-to-zero test coverage. For its
weaknesses, Three20 does provide a good deal of value through its
feature set. It is used in over 100 apps in the app store by companies
such as Facebook, LinkedIn, Posterous, Meetup, and SCVNGR.
Nimbus hopes to one day provide as much value as Three20 does on a
feature-by-feature comparison, but with the invaluable benefit of
sublime documentation and test coverage.