Code Monkey home page Code Monkey logo

cocos-helper's People

Contributors

achoura avatar hoangtaiki avatar lassade avatar nickenchev avatar oscarleif avatar sheldon5 avatar sonarsystems 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  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  avatar  avatar  avatar  avatar

Watchers

 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

cocos-helper's Issues

Doesn't comile on Linux. Fatal error: jni.h

Comiling from command line on Linux platform

cocos compile -p linux -m debug

In file included from JNIResults.cpp: 9:0:
JNIResults.h:15:17: fatal error: jni.h: No such file or directory

This very strange, because there is #if in JNIResults.h file

#if(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <jni.h>
#include "platform/android/jni/JniHelper.h"
#include <android/log.h>
#include "cocos2d.h"
#include "SonarFrameworks.h"
#endif

The jni.h must not be included for Linux compilation

Google Play Services userID

Hi.
Is that possible to get UserID and Name from Google Play Services that i can next use at my server as player login?

Banner Ads not being displayed after app resume

Im having a weird issue with the AdMob ads. When the game starts, the ads are shown, thats fine. If I move to a new scene with Director::getInstance()->replaceScene(); The new scene loads, the ads are there, all is fine.

But on Google Analytics it shows that the active screen is

com.google.android.gms.ads.AdActivity

even though I have set the screen name using

SonarCocosHelper::GoogleAnalytics::setScreenName("Game Scene");

The problem occurs when I press the home button on my Galaxy S4. The app moves to the background, then when it is opened again the banner ads are gone. If I then use the Quit button which calls Director::getInstance()->end(); the screen goes black but the game just reloads, and the ads are displayed again. Its like there is a layer being created over the game showing the ads that is closed when I first hit Quit.

Im putting it down to the com.google.android.gms.ads.AdActivity created for displaying the ads.

How do I get the banner ads to be displayed after the app is resumed from being in the background? Or close the com.google.android.gms.ads.AdActivity view when the game is put in the background and then create it again on resume?

Build error Google play services

Hi.

First of all, thank you for your work that you do for Cocos2d-x community, i am really appreciate it.
I have a problem with building my project with usage GooglePlayServices, i setup it correctly as you described at the video, but i need to notice you, i am also used SDKBOX from cocos2dx team.

i try to build project with command: cocos compile -p android
here is error output:

    [javac] Compiling 11 source files to /proj.android/bin/classes
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:32: error: package com.google.android.gms.appstate does not exist
    [javac] import com.google.android.gms.appstate.AppStateManager;
    [javac]                                       ^
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:307: error: cannot find symbol
    [javac]             builder.addApi(AppStateManager.API);
    [javac]                            ^
    [javac]   symbol:   variable AppStateManager
    [javac]   location: class GooglePlayServicesGameHelper
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:308: error: cannot find symbol
    [javac]             builder.addScope(AppStateManager.SCOPE_APP_STATE);
    [javac]                              ^
    [javac]   symbol:   variable AppStateManager
    [javac]   location: class GooglePlayServicesGameHelper
    [javac] 3 errors

can you please help me with that?
forgot about my environment: ndk r10e, gps v.27, cocos2dx 3.8.1
Thanks.

Crash when use Admod in iOS

2015-07-16 19:43:04.834 TestAndroid-mobile[9001:247857] -[GADInterstitial initWithAdUnitID:]: unrecognized selector sent to instance 0x7fa6e0eb2300
2015-07-16 19:43:04.838 TestAndroid-mobile[9001:247857] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADInterstitial initWithAdUnitID:]: unrecognized selector sent to instance 0x7fa6e0eb2300'
*** First throw call stack:
(
0 CoreFoundation 0x000000010bc2cc65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b805bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010bc340ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010bb8a13c __forwarding
+ 988
4 CoreFoundation 0x000000010bb89cd8 _CF_forwarding_prep_0 + 120
5 TestAndroid-mobile 0x000000010785cca7 -[IOSHelper requestAdMobFullscreenAd] + 87
6 TestAndroid-mobile 0x000000010785b605 -[IOSHelper initialise] + 245
7 TestAndroid-mobile 0x00000001078539e9 _ZN12IOSCPPHelper5SetupEv + 41
8 TestAndroid-mobile 0x0000000107853d59 _ZN16SonarCocosHelper3IOS5SetupEv + 9
9 TestAndroid-mobile 0x00000001078595e3 _ZN10HelloWorld4initEv + 2611
10 TestAndroid-mobile 0x00000001078598e6 _ZN10HelloWorld6createEv + 150
11 TestAndroid-mobile 0x0000000107858b76 _ZN10HelloWorld11createSceneEv + 22
12 TestAndroid-mobile 0x00000001078537c9 _ZN11AppDelegate29applicationDidFinishLaunchingEv + 825
13 TestAndroid-mobile 0x00000001078cacf4 _ZN7cocos2d11Application3runEv + 36
14 TestAndroid-mobile 0x000000010785b225 -[AppController application:didFinishLaunchingWithOptions:] + 997
15 UIKit 0x0000000109ef1748 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 240
16 UIKit 0x0000000109ef2357 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2540
17 UIKit 0x0000000109ef519e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
18 UIKit 0x0000000109ef4095 -[UIApplication workspaceDidEndTransaction:] + 179
19 FrontBoardServices 0x000000010e8b25e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
20 CoreFoundation 0x000000010bb6041c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
21 CoreFoundation 0x000000010bb56165 __CFRunLoopDoBlocks + 341
22 CoreFoundation 0x000000010bb55f25 __CFRunLoopRun + 2389
23 CoreFoundation 0x000000010bb55366 CFRunLoopRunSpecific + 470
24 UIKit 0x0000000109ef3b02 -[UIApplication _run] + 413
25 UIKit 0x0000000109ef68c0 UIApplicationMain + 1282
26 TestAndroid-mobile 0x000000010785d224 main + 100
27 libdyld.dylib 0x000000010c482145 start + 1
28 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Chartboot ShowVideoAs is not a member of SonarCocosHelper::Chartboost

jni/../../Classes/IntroScene.cpp:50:2: error: 'ShowVideoAd' is not a member of '
SonarCocosHelper::Chartboost'
SonarCocosHelper::Chartboost::ShowVideoAd();
^
jni/../../Classes/IntroScene.cpp: In member function 'virtual bool IntroScene::i
nit()':
jni/../../Classes/IntroScene.cpp:50:2: error: 'ShowVideoAd' is not a member of '
SonarCocosHelper::Chartboost'
SonarCocosHelper::Chartboost::ShowVideoAd();
^
At global scope:

tvOS support

Hi,

Are there any plans to update the helper for tvOS? I would love to use the Game Center wrapper for both iOS and tvOS.

Cheers,
Lennert

Using Chartboost via SonarCocosHelper

Hi!

I successfully added Chartboost with your Cocos Helper! Great!

Now I called SonarCocosHelper::Chartboost::showFullscreenAd();. After this call I am using the cocos2d-x director to replace the current Scene. Sadly the scene is replaced and after that the fullscreen ad is shown. The game itself isn't paused. How can i achieve that a) the ad is shown before the replace and b) the app is paused like it's when using admob.

Thanks!

RevMob 9.0.4 needs CoreLocation.framework

define SCH_IS_REVMOB_ENABLED true // SystemConfiguration.framework, StoreKit.framework, MediaPlayer.framework, AdSupport.framework

Also needs CoreLocation.framework, or won't compile (Revmob-sdk v.9.0.4)

SonarCocosHelper/SonarFrameworks.h: No such file or directory

I'm using cocos2d-js 3.7 and followed your tutorial at: http://www.sonarlearning.co.uk/coursepage.php?topic=game&course=sonar-cocos-helper-js&videoindex=6489#6489

Compilation gives me this error:

In file included from jni/../../Classes/JNIResults.cpp:9:0:
jni/../../Classes/JNIResults.h:19:46: fatal error: SonarCocosHelper/SonarFrameworks.h: No such file or directory
 #include "SonarCocosHelper/SonarFrameworks.h"

This file sure do include the SonarFrameworks.h which is never referenced in your video.

Please help!

Cocos v3.10 compilations fails: SonarFrameworks.h: No such file or directory

Was getting this error with Cocos2dx 3.8 and Cocos Helper v1.48.00 in my Mac!

Then upgraded to Cocos2dx 3.10 and getting the same error. Tried fixing one error and the other error shows up.

  • Err1: SonarCocosHelper/SonarFrameworks.h: No such file or directory
    • Copied SonarFrameworks.h, SonarFrameworks.cpp to Classes from /SonarCocosHelperCPP
  • Err2: jni/../../Classes/SonarFrameworks.h:23:24: fatal error: JNIHelpers.h: No such file or directory
    • Copied JNIHelpers.h, JNIHelpers.cpp to Classes from /External Cocos Helper Android Frameworks/Classes
  • Err3: jni/../../Classes/JNIResults.cpp:30: error: undefined reference to 'SonarCocosHelper::AdMob::showPreLoadedFullscreenAd()' and jni/../../Classes/JNIResults.cpp:41: error: undefined reference to 'SonarCocosHelper::Chartboost::showFullscreenAd()'
    • Updated Android.mk as follows:
    • LOCAL_SRC_FILES := hellojavascript/main.cpp \
    • ../../Classes/AppDelegate.cpp \
    • ../../Classes/JNIResults.cpp \
    • ../../Classes/JNIHelpers.cpp \
    • ../../Classes/SonarFrameworks.cpp
  • [aapt] /Users/saiy2k/projects/bonar/frameworks/runtime-src/proj.android/bin/AndroidManifest.xml:2: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android
    • Removed android:hardwareAccelerated="true" from the AndroidManifest.xml

After all this steps, the Project compiled successfully. But on app launch, it shows Unfortunately, App has stopped.

Please help.

A few feature requests.

Great helper library. Much better than the complicated yet incomplete cocos official sdkbox. Code clarify is great, and I find it really easy to add extra features not found in current version. Overall really great work.

Feature requests:

  1. It would be nice to have Facebook/Twitter share success returned, or allow passing in a completion callback. iOS supports this natively.
  2. It would be nice to support InApp billing and receipt verification. Cocos-helper as complete as it is, still sends me to use another iap sdk.
  3. It would be nice to not having to set strings in values.xml. I'm not sure what the motivation is, but having Facebook app id scattered in 2 places seems inconvenient.

Cocos v3.9 compilations fails: SonarFrameworks.h: No such file or directory

Hello everyone!

I am using Cocos2d-x v3.9 with javascript.
I have a clean javascript project (freshly created with 'cocos new -l js') and I am trying to integrate the cocos helper plugin. I follow your video, up to before the point you open eclipse with ADT. Since ADT is not supported by google anymore, I don't use it.

If I try to generate an apk (via command line, 'cocos compile -p android'), compilation fails with the following error:
In file included from jni/../../Classes/JNIResults.cpp:9:0:
jni/../../Classes/JNIResults.h:19:29: fatal error: SonarFrameworks.h: No such file or directory #include "SonarFrameworks.h"
^ compilation terminated.

I understand we shouldn't need this header file in a javascript project, so what is missing?

thank you in advance!

Admob preload interstitial

I've been waiting for a long long time for preload insterstitial/show preloaded interstitial to be get working by you guys :) It's not working.

With Cocos2dx V3.9, Admob Crash in Android

Hi, when I use this helper, the following error exist:

java.lang.NullPointerException
sonar.systems.framework.SonarFrameworkFunctions.ShowBannerAd(SonarFrameworkFunctions.java:721)

My app crash when try to load the Admob. Could you help to solve? Thanks

Game crash when use google play services

i use cocos2dx v3.10, and Android studio for dev, when i use google playservice (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES). My game crash when call:
if (!SonarCocosHelper::GooglePlayServices::isSignedIn()) {
SonarCocosHelper::GooglePlayServices::signIn();
}


Log crash:

02-20 23:38:07.386 12311-12358/com.mystudio.puzzlegame W/GooglePlayServicesUtil: Google Play services out of date. Requires 8487000 but found 7574036
02-20 23:38:07.436 12311-12422/com.mystudio.puzzlegame W/GooglePlayServicesUtil: Google Play services out of date. Requires 8487000 but found 7574036
02-20 23:38:07.576 12311-12356/com.mystudio.puzzlegame D/CocosPlayClient.cpp: isEnabled = 0
02-20 23:38:07.576 12311-12356/com.mystudio.puzzlegame D/CocosPlayClient.cpp: isDemo = 0
02-20 23:38:07.576 12311-12356/com.mystudio.puzzlegame D/CocosPlayClient.cpp: isNotifyFileLoadedEnabled = 0
02-20 23:38:07.656 12311-12311/com.mystudio.puzzlegame D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
02-20 23:38:08.447 12311-12356/com.mystudio.puzzlegame D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
02-20 23:38:08.447 12311-12356/com.mystudio.puzzlegame V/Cocos2dxActivity: cancelLocalNotification
02-20 23:38:08.467 12311-12356/com.mystudio.puzzlegame V/Cocos2dxActivity: showLocalNotification
02-20 23:38:08.467 12311-12356/com.mystudio.puzzlegame W/dalvikvm: dvmFindClassByName rejecting 'sonar/systems/framework/SonarFrameworkFunctions'
02-20 23:38:08.467 12311-12356/com.mystudio.puzzlegame D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
02-20 23:38:08.757 12311-12356/com.mystudio.puzzlegame D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
02-20 23:38:08.807 12311-12356/com.mystudio.puzzlegame W/dalvikvm: Invalid indirect reference 0x41c89300 in decodeIndirectRef
02-20 23:38:08.807 12311-12356/com.mystudio.puzzlegame E/dalvikvm: VM aborting
02-20 23:38:09.188 12311-12311/com.mystudio.puzzlegame W/dalvikvm: VFY: unable to resolve virtual method 16398: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
02-20 23:38:09.198 12311-12311/com.mystudio.puzzlegame W/dalvikvm: VFY: unable to resolve virtual method 16409: Landroid/webkit/WebView;.evaluateJavascript (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
02-20 23:38:09.208 12311-12311/com.mystudio.puzzlegame W/dalvikvm: VFY: unable to resolve virtual method 41000: Lcom/google/android/gms/internal/zzjt;.isAttachedToWindow ()Z
02-20 23:38:09.498 12311-12370/com.mystudio.puzzlegame E/SQLiteLog: (1) no such table: CacheGroups
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: ERROR:
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: Application Cache Storage: failed to execute statement "DELETE FROM CacheGroups" error "no such table: CacheGroups"
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame E/SQLiteLog: (1) no such table: Caches
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: ERROR:
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: Application Cache Storage: failed to execute statement "DELETE FROM Caches" error "no such table: Caches"
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame E/SQLiteLog: (1) no such table: Origins
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: ERROR:
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: Application Cache Storage: failed to execute statement "DELETE FROM Origins" error "no such table: Origins"
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame D/WebKit: external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
02-20 23:38:09.508 12311-12370/com.mystudio.puzzlegame E/SQLiteLog: (1) no such table: DeletedCacheResources
02-20 23:38:09.598 12311-12356/com.mystudio.puzzlegame A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 12356 (Thread-8624)

Pls help me fix that.

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.