Git Product home page Git Product logo

admob-openfl's People

Contributors

mkorman9 avatar sanafa avatar sergiob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

admob-openfl's Issues

Crashing on iOS on AD.show()

Running AD.show() too many times (roughly 12) causes iPad to crash due to memory error.
Can be reproduced by simply calling AD.show() over and over, or through general app usage.

Interstitial error

is there any example code on Interstitial?
i tried initInterstitial then showInterstitial but it quit my apps

thanks

Interstitial doesn't pause game on iOS

On Android, when the interstitial appears the game pauses automatically, but on iOS the game keeps running. I'm not sure if this is a bug in the extension, or just the way AdMob works. It would be nice to at least have a way to know when the ad is closed.

Interstitial Ads Freeze on Android

Showing an interstitial causes the app to freeze. It will stay frozen indefinitely until the X button on the ad is clicked. If the X button is clicked, the app stays frozen, but then crashes soon after with a "Not responding" error.

The ad is being loaded in test mode.

Build halted with errors.

I have done both of these ;

Copy android-template directory to your project
Add following code to your project.xml:

But It gives me this error ;

BUILD FAILED
C:\Users\-username-\AppData\Local\Android\sdk\tools\ant\build.xml:716: The following error occurred while executing this line:

C:\Users\-username-\AppData\Local\Android\sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.

And

 error: cannot find symbol
    [javac]     private Sound _sound;
    [javac]             ^
    [javac]   symbol:   class Sound
    [javac]   location: class GameActivity

How and where to include <haxelib name="admob" />

Hello,

I have tried to include it in project.xml, but when I compile the game it says in flashdevelop:
"Error: Could not find haxelib "admob", does it need to be installed?"

How to solve this? I am using haxeflixel.

Edit Solved, forgot the first git command.
Thanks

Cant make it work on android

I am trying to make it work on android.
I followed the instruction of the README file but I am having errors:

Here are the errors displayed on console when tested on android with -debug mode:

E/VoldConnector( 358): NDC Command {968 asec create smdl2tmp1 24 ext4 68a0d2b3a9e09a6453e1b84f2ecdc24d 10013 1} took too long (3958ms)
E/ProcessKiller( 91): Process android.process.acore (27662) has open file /mnt/asec/com.tbdlab.stayontrack-2/pkg.apk
E/ExternalAccountType(27642): Unsupported attribute readOnly
E/ExternalAccountType(27642): Unsupported attribute readOnly
E/Launcher( 9940): AppsCustomizePagedView, Widget ComponentInfo{com.google.android.googlequicksearchbox/com.google.android.apps.sidekick.widget.PredictiveCardsWidgetProvider} can not fit on this device (450, 375)
E/Launcher( 9940): AppsCustomizePagedView, Widget ComponentInfo{com.sand.airdroid/com.sand.airdroid.ui.widget.ConnectionWidget} can not fit on this device (444, 90)
E/ProcessKiller( 91): Process android.process.acore (27662) has open file /mnt/asec/com.tbdlab.stayontrack-2/pkg.apk
E/VoldConnector( 358): NDC Command {979 asec unmount com.tbdlab.stayontrack-2 force} took too long (3146ms)
E/jdwp (27930): jdwp::setsockopt(SO_SNDTIMEO)
E/jdwp (27930): jdwp::setsockopt(SO_RCVTIMEO)
E/jdwp (28054): jdwp::setsockopt(SO_SNDTIMEO)
E/jdwp (28054): jdwp::setsockopt(SO_RCVTIMEO)
E/dalvikvm(27752): Could not find class 'android.os.UserHandle', referenced from method com.google.android.gms.gcm.f.a
E/dalvikvm(28106): Could not find class 'android.os.UserManager', referenced from method eu.chainfire.supersu.User.a
E/dalvikvm(28069): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
E/dalvikvm(28069): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
E/GooglePlayServicesUtil(28069): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

Any help would be highly appreciated

Can't get it work on Android

Hi there,

The extension works great on iOS. Now I try to publish it on Android. Since Openfl 1.4 has some Lib.hx issue (saw in another thread) and crashed my game every time the ad initialisation was called , I have to build it with Openfl 1.3. The game looks fine however no ad show up at all.

Btw, I tested it on a device with clean Android 2.3.5 without Google Play store. Most of Android devices here China don't have Google Play services installed. I think Admob should works on these devies without issues.

Here is part of log:
04-26 16:04:29.699: E/GooglePlayServicesUtil(6759): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-26 16:04:29.709: W/GooglePlayServicesUtil(6759): Google Play services is missing.
04-26 16:04:29.989: I/Ads(6759): Starting ad request.
04-26 16:04:30.489: W/Ads(6759): There was a problem getting an ad response. ErrorCode: 2
04-26 16:04:30.489: I/Ads(6759): Scheduling ad refresh 60000 milliseconds from now.
04-26 16:04:30.489: W/Ads(6759): Failed to load ad: 2

App crashes on android on initiation

I compiled a simple openFl project but it crashed on a device, testing with logcat gave:
java.lang.NoSuchMethodError: no static method with name='initAd' signature='(Ljava/lang/String;IIZ)V' in class Lorg/haxe/lime/GameActivity;

I'm not sure if it matters but there is no "initAd" and other ads functions in Export\android\bin\src\org\haxe\lime\GameActivity.java

I've added android-template to my project source folder and code to my project.xml.

Still based on the outdated NMEX extension?

Hi, thanks for the great plugin. I want to ask if it's still based on the old NMEX extension or the Readme.md file is outdated. If it's still based on the old NMEX, can it work properly with the latest version of openfl?

Android error, Lib.hx:300: Invalid Arg Count

I tried the latest admob-openfl for OpenFL 1.4 on Android. It seems that an error occurs with the next line of AD.hx.

_initAd_func = openfl.utils.JNI.createStaticMethod("org.haxe.lime.GameActivity", "initAd", "(Ljava/lang/String;IIIZ)V", true);

adb logcat

Lib.hx:300: Invalid Arg Count

What knows whether it is the cause?

Can't compile for iOS anymore

It seems that I can't compile this for iOS anymore (but was working some time ago). Below is the error I get. Any ideas? Thanks.

Ld build/Release-iphoneos/LR.app/LR normal armv7
cd /Users/vasco/Desktop/LR/export/ios
export IPHONEOS_DEPLOYMENT_TARGET=5
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/vasco/Desktop/LR/export/ios/build/Release-iphoneos -L/Users/vasco/Desktop/LR/export/ios/LR/lib/armv7 -F/Users/vasco/Desktop/LR/export/ios/build/Release-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks -filelist /Users/vasco/Desktop/LR/export/ios/build/LR.build/Release-iphoneos/LR.build/Objects-normal/armv7/LR.LinkFileList -dead_strip -lstd -lregexp -lzlib -llime -lcurl_ssl -lpng -ljpeg -lfreetype -logg -lvorbis -lApplicationMain -stdlib=libc++ -force_load /usr/lib/haxe/lib/admob/git/ndll/iPhone/libGoogleAdMobAds.a -miphoneos-version-min=5 -framework UIKit -framework OpenAL -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework CoreGraphics -framework AudioToolbox -framework AVFoundation -framework Foundation -framework CoreMotion -framework MediaPlayer -framework CoreMedia -Xlinker -dependency_info -Xlinker /Users/vasco/Desktop/LR/export/ios/build/LR.build/Release-iphoneos/LR.build/Objects-normal/armv7/LR_dependency_info.dat -o /Users/vasco/Desktop/LR/export/ios/build/Release-iphoneos/LR.app/LR
Undefined symbols for architecture armv7:
"_SCNetworkReachabilityCreateWithAddress", referenced from:
l001 in libGoogleAdMobAds.a(GADGestureUtil.o)
"_SCNetworkReachabilitySetCallback", referenced from:
-[GADNetworkChecker startNetworkChecking] in libGoogleAdMobAds.a(GADNetworkChecker.o)
"OBJC_CLASS$_MFMessageComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_SCNetworkReachabilityGetFlags", referenced from:
l001 in libGoogleAdMobAds.a(GADGestureUtil.o)
"OBJC_CLASS$_MFMailComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"OBJC_CLASS$_SKStoreProductViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
-[GADOpener openInAppStore:fallbackURLString:] in libGoogleAdMobAds.a(GADOpener.o)
"OBJC_CLASS$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADDevice.o)
objc-class-ref in libGoogleAdMobAds.a(GADGestureIdUtil.o)
"_SCNetworkReachabilityCreateWithName", referenced from:
-[GADNetworkChecker startNetworkChecking] in libGoogleAdMobAds.a(GADNetworkChecker.o)
"OBJC_CLASS$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADDevice.o)
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
-[GADNetworkChecker stopNetworkChecking] in libGoogleAdMobAds.a(GADNetworkChecker.o)
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
-[GADNetworkChecker startNetworkChecking] in libGoogleAdMobAds.a(GADNetworkChecker.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld build/Release-iphoneos/LR.app/LR normal armv7
(1 failure)

java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.

I used this new extension for Android. However, an error occurs and Android app crashes.

> adb logcat
java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Next, I added meta-data into android-template/AndroidManifest.xml.

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Then, the compile error occurred.

> lime test android
Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

Although it seems that it will solve if the directory of google-play-services_lib is imported, I do not understand the method.

When I rewrote meta-data below, the compile error stopped occurring. However, this method is not general-purpose.

<meta-data android:name="com.google.android.gms.version" android:value="4323000" />

Moreover, now, an advertisement is not displayed yet. The following errors occur. (This error has the possibility of the problem on the development machine side.)

> adb logcat

I/Ads     ( 6297): Use AdRequest.Builder.addTestDevice("my deveice id") to get test ads on this device.
I/Ads     ( 6297): Starting ad request.
V/WebViewChromium( 6297): Binding Chromium to the main looper Looper (main, tid 1) {41f18850}
I/chromium( 6297): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain( 6297): Initializing chromium process, renderers=0
W/chromium( 6297): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
E/GooglePlayServicesUtil( 6297): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
E/GooglePlayServicesUtil( 6297): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
E/GooglePlayServicesUtil( 6297): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
I/Ads     ( 6297): No fill from ad server.
W/Ads     ( 6297): Failed to load ad: 3

In iOS, google throws a message and do not show ads

Three weeks ago, when I installed admob-openfl, it was fine, I could see ads in iOS simulator.
Today I have tried to compile and run it on Simulator and iPhone4. I don't see any ads and log terminal gives me this on iPhone:
<Google> To get test ads on this device, call: request.testDevices = @[ @"f608f152b8b49866843a7f14a6a6b72c" ];
and this on iOS simulator:
<Google> To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];
But I didn't choose to run it in test mode - I pass "false" as "test" argument in AD.init() function. What could be wrong there?

New version request

Google requires to use Google Services instead of separate AdMob jar.
There are changes that should be made in code:
In GameActivity:

  • import instead of com.google.ads.* - com.google.android.gms.ads.*
  • You can't create AdRequest using new AdRequest() anymore. You need to use AdRequest.Builder in order to create an instance.
  • AdView constructor does not expect all the arguments anymore.

In AndroidManifest.xml

  • com.google.ads.AdActivity should be replaced by com.google.android.gms.ads.AdActivity

And of cource, you can not include GoogleAdMobAdsSdk-6.4.1.jar anymore, since it conflicts with Play Services jar

Java error - compile failure

When implementing your files now, I've been getting a compile error with this output:
-compile:

[javac] C:\Users\Matzerath\Desktop\OrangeHaxe\bin\android\bin\src\org\haxe\lime\GameActivity.java:172: cannot find symbol
[javac] symbol  : variable packageName
[javac] location: class org.haxe.extension.Extension
[javac]         Extension.packageName = getApplicationContext ().getPackageName ();
[javac]                  ^
[javac] C:\Users\Matzerath\Desktop\OrangeHaxe\bin\android\bin\src\org\haxe\lime\GameActivity.java:587: cannot find symbol
[javac] symbol  : method onLowMemory()
[javac] location: class org.haxe.extension.Extension
[javac]             extension.onLowMemory ();
[javac]                      ^
[javac] C:\Users\Matzerath\Desktop\OrangeHaxe\bin\android\bin\src\org\haxe\lime\GameActivity.java:598: cannot find symbol
[javac] symbol  : method onNewIntent(android.content.Intent)
[javac] location: class org.haxe.extension.Extension
[javac]             extension.onNewIntent (intent);
[javac]                      ^
[javac] C:\Users\Matzerath\Desktop\OrangeHaxe\bin\android\bin\src\org\haxe\lime\GameActivity.java:708: cannot find symbol
[javac] symbol  : method onTrimMemory(int)
[javac] location: class org.haxe.extension.Extension
[javac]             extension.onTrimMemory (level);
[javac]                      ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 4 errors

BUILD FAILED
C:\Development\sdk\tools\ant\build.xml:720: The following error occurred while executing this line:
C:\Development\sdk\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

I've tried various things to fix this (updated haxelib, changed SDK build, other madness) but get the same errors every time. Any thoughts? I did have this working previously, so maybe an openFL/Lime update is causing problems -- or I just screwed something up!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.