"sdkbox import anysdk" failed!

"sdkbox import anysdk" failed!
0.0 0

#1

I have created a new cocos project - Hello World and built the project for template binary.
And then I tried “sdkbox import anysdk” in console.
It failed. Why? Instead of anysdk, iap is ok.
How can I fix it? Please help me. Urgent!!!

Following is the result.

D:\MyPojects\Mobile-Games\cymj\build\jsb-binary>sdkbox import anysdk --v


|______ | \ |____/ |] | | _/
| |/ | _ |
] |____| _/ _
Copyright © 2016-2017 SDKBOX Inc. v1.0.1.24
test speed of hosts…

  • test host main: 33.70KB/s.
  • test host china: 260.23KB/s.
    choose the fastest server ‘china’, speed is 260.23KB/s.
    Namespace(alwaysupdate=0, command=‘import’, days=10, dryrun=None, forcecopy=0, forcedownload=0, info=None, installer=‘C:/MinGW/msys/1.0/home/.sdkbox/bin/sdkbox.pyc’, jsonapi=0, legacy=None, local=0, manifest=‘manifest.json’, mkey=None, mvalue=None, nohelp=0, nopatching=0, nopatchingcpp=0, noupdate=0, patcherrors=0, plugin=‘anysdk/’, project=‘D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/’, remote=1, runin=None, server=‘120.55.89.27:4097/installer/v1/’, symbol=None, verbose=1)
    get remote manifest from http://120.55.89.27:4097/installer/v1/manifest.json
    cocos2d-x installation directory D:/cocos2d-x-3.16/
    cocos2d-x header directory D:/cocos2d-x-3.16/cocos/
    cocos2d-x installation version 3.16.0
    found 2.x project version 3.16.0
    cocos2d-x project root D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/
    fallback to cocos project search False
    cocos2d-x project type js
    loaded package manifest
    loaded cocos project
    failed to load xcode project
    loaded visual studio project
    loaded android project
    load android studio project
    supported projects cocos visual studio android android studio
    package base name anysdk
    skipping download of sdkbox-anysdk_v2.3.17.1.tar.gz, already exists as C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/
    setting plugin source to C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/
    SHA1 of downloaded package 76e01f5a857f17b853ad00fd643f84e4eb4a8115
    adding to backup Android.mk.f9d2mgru.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/Android.mk
    adding to backup Application.mk.zW9GuaEF.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/Application.mk
    adding to backup AndroidManifest.xml.97IHtuaF.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/AndroidManifest.xml
    adding to backup project.properties.VJ3NUQyw.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/project.properties
    found sdkbox.package at C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/sdkbox.package
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/drawable/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/values-en/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/layout/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/libs/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/mipmap/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/values-en/
    creating D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/layout/
    checking patch status of file AppDelegate.cpp against patch AppDelegate.js3.11.patch
    preprocessing patch AppDelegate.js3.11.patch into AppDelegate.js3.11.patch.DyY67mLo.sdkbox.temp
    adding to backup AppDelegate.cpp.yE4ZrxoH.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/Classes/AppDelegate.cpp
    checking patch status of file AppActivity.java against patch AppActivity.js3.9prebuilt.patch
    preprocessing patch AppActivity.js3.9prebuilt.patch into AppActivity.js3.9prebuilt.patch.xvoJARQ8.sdkbox.temp
    adding to backup AppActivity.java.yfRnL8pD.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java
    checking patch status of file main.cpp against patch main.js3.9prebuilt.patch
    preprocessing patch main.js3.9prebuilt.patch into main.js3.9prebuilt.patch.5QbDidBR.sdkbox.temp
    adding to backup main.cpp.9qaXQ3MY.sdkbox.temp as D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/Classes/AppDelegate.cpp from AppDelegate.cpp.yE4ZrxoH.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/project.properties from project.properties.VJ3NUQyw.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java from AppActivity.java.yfRnL8pD.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/Application.mk from Application.mk.zW9GuaEF.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp from main.cpp.9qaXQ3MY.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/AndroidManifest.xml from AndroidManifest.xml.97IHtuaF.sdkbox.temp
    Saving to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/jni/Android.mk from Android.mk.f9d2mgru.sdkbox.temp
    Creating backup archive D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/backup-2017-11-23.zip
    Backup Completed.
    skipped xcode_add_compiler_flag -DSDKBOX_ENABLED
    android added key:valueLOCAL_CPPFLAGS–DSDKBOX_ENABLED
    android added key:valueLOCAL_CPPFLAGS–DSDKBOX_ENABLED
    skipped xcode_add_compiler_flag -DSDKBOX_COCOS_CREATOR
    android added key:valueLOCAL_CPPFLAGS–DSDKBOX_COCOS_CREATOR
    android added key:valueLOCAL_CPPFLAGS–DSDKBOX_COCOS_CREATOR
    copy C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/android/protocols_gnustl_static to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/android/libPluginProtocol.jar to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/drawable/plugin_btn_close.png to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/drawable/plugin_ui_ad.png to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/values-en/plugin_string.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/values/plugin_string.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/layout/plugin_ads.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/protocols/res/layout/plugin_login.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
    skipped android_add_static_library PluginProtocolStatic
    skipped android_set_permission INTERNET False
    skipped android_set_permission ACCESS_NETWORK_STATE False
    skipped android_set_permission ACCESS_WIFI_STATE False
    skipped android_set_permission RESTART_PACKAGES False
    skipped android_set_permission KILL_BACKGROUND_PROCESSES False
    copy C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/android/protocols_gnustl_static to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/android/libPluginProtocol.jar to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/drawable/plugin_btn_close.png to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/drawable/plugin_ui_ad.png to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/values-en/plugin_string.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/values/plugin_string.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/mipmap/plugin_ads.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml
    copy D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/protocols/res/mipmap/plugin_login.xml to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml
    copy C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/ios/protocols_libstdc++ to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.ios_mac/protocols
    skipped xcode_add_folder D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/frameworks/runtime-src/proj.ios_mac/protocols
    skipped xcode_add_framework CFNetwork.framework
    skipped xcode_add_framework CoreFoundation.framework
    skipped xcode_add_framework MobileCoreServices.framework
    skipped xcode_add_framework SystemConfiguration.framework
    skipped xcode_add_framework MediaPlayer.framework
    skipped xcode_add_framework GameController.framework
    skipped xcode_add_framework Security.framework
    skipped xcode_add_framework libz.dylib
    skipped xcode_add_linker_flag -ObjC
    copy C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/jsbindings/jsb_anysdk_constants.js to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/src/jsb_anysdk_constants.js
    copy C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/plugin/jsbindings/jsb_anysdk.js to D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/src/jsb_anysdk.js
    patching file AppDelegate.cpp with patch AppDelegate.js3.11.patch
    preprocessing patch AppDelegate.js3.11.patch into AppDelegate.js3.11.patch.mOW4DME2.sdkbox.temp
    failed to apply hunk 0

@@ -43,3 +43,9 @@
#include “cocos/scripting/js-bindings/manual/platform/ios/JavaScriptObjCBridge.h”
#endif

+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+#include “AgentManager.h”
+#include “jsb_anysdk_protocols_auto.hpp”
+#include “manualanysdkbindings.hpp”
+using namespace anysdk::framework;
+#endif
<<<<
failed to apply hunk 1

@@ -53,3 +60,7 @@
AppDelegate::~AppDelegate()
{
ScriptEngineManager::destroyInstance();
+
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

  • AgentManager::getInstance()->unloadAllPlugins();
    +#endif
    <<<<
    failed to apply hunk 2

@@ -64,3 +75,19 @@

bool AppDelegate::applicationDidFinishLaunching()
{
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

  • /**
  • * appKey?갵ppSecret?걈rivateKey?€誤곦퍗?볟똿藥ε끁訝?만?뤹??녺븣??렩?뽳펽?욘뜟
    
  • * oauthLoginServer?귝빊??만?뤸쐨?→룓堊쏁쉪?ⓩ씎?싩쇉?녽챿瑥곮쉬?묊쉪?ε룭?겼???
    
  • */
    
  • std::string oauthLoginServer = “OAUTH_LOGIN_SERVER”;
  • std::string appKey = “APP_KEY”;
  • std::string appSecret = “APP_SERCRET”;
  • std::string privateKey = “PRIVATE_KEY”;
  • AgentManager* pAgent = AgentManager::getInstance();
  • pAgent->init(appKey,appSecret,privateKey,oauthLoginServer);
  • //鵝욜뵪旅녷왃訝?빰?녺굳瓦쏂죱?믢뻑?앭쭓?
  • pAgent->loadAllPlugins();
    +#endif
    <<<<
    failed to apply hunk 3

@@ -150,3 +177,8 @@
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
sc->addRegisterCallback(JavaScriptObjCBridge::_js_register);
#endif
+
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

  • sc->addRegisterCallback(register_all_anysdk_framework);
  • sc->addRegisterCallback(register_all_anysdk_manual);
    +#endif
    <<<
    failed to patch file AppDelegate.cpp
    patching file AppActivity.java with patch AppActivity.js3.9prebuilt.patch
    preprocessing patch AppActivity.js3.9prebuilt.patch into AppActivity.js3.9prebuilt.patch.T3ue6xnh.sdkbox.temp
    failed to apply hunk 1

@@ -45,3 +48,5 @@
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);

  •    PluginWrapper.init(this);
    
  •    PluginWrapper.setGLSurfaceView(Cocos2dxGLSurfaceView.getInstance());
    

<<<
failed to apply hunk 2

@@ -80,3 +85,43 @@
private static native boolean nativeIsLandScape();
private static native boolean nativeIsDebug();

  •  @Override
    
  •  protected void onResume() {
    
  •          super.onResume();
    
  •          PluginWrapper.onResume();
    
  •  }
    
  •  @Override
    
  •  protected void onPause() {
    
  •          super.onPause();
    
  •          PluginWrapper.onPause();
    
  •  }
    
  •  @Override
    
  •  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    
  •          super.onActivityResult(requestCode, resultCode, data);
    
  •          PluginWrapper.onActivityResult(requestCode, resultCode, data);
    
  •  }
    
  •  @Override
    
  •  protected void onDestroy() {
    
  •          super.onDestroy();
    
  •          PluginWrapper.onDestroy();
    
  •  }
    
  •  @Override
    
  •  protected void onNewIntent(Intent intent) {
    
  •          super.onNewIntent(intent);
    
  •          PluginWrapper.onNewIntent(intent);
    
  •  }
    
  •  @Override
    
  •  protected void onRestart() {
    
  •          super.onRestart();
    
  •          PluginWrapper.onRestart();
    
  •  }
    
  •  @Override
    
  •  protected void onStop() {
    
  •          super.onStop();
    
  •  }
    

<<<
failed to patch file AppActivity.java
patching file main.cpp with patch main.js3.9prebuilt.patch
preprocessing patch main.js3.9prebuilt.patch into main.js3.9prebuilt.patch.HJIprVc8.sdkbox.temp
failed to apply hunk 0

@@ -4,12 +4,23 @@
#include <jni.h>
#include <android/log.h>
#include “ide-support/SimpleConfigParser.h”
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+#include “PluginJniHelper.h”
+#endif

#define LOG_TAG “main”
#define LOGD(…) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,VA_ARGS)

using namespace cocos2d;
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+using namespace anysdk::framework;
+#endif

void cocos_android_app_init (JNIEnv* env) {
LOGD(“cocos_android_app_init”);
AppDelegate *pAppDelegate = new AppDelegate();
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

  • JavaVM* vm;
  • env->GetJavaVM(&vm);
  • PluginJniHelper::setJavaVM(vm);
    +#endif
    <<<
    failed to patch file main.cpp
    Please reference the online documentation to finish the integration:
    http://docs.anysdk.com/JsTutorial

WARNING <<<
Some installation steps failed.
Please refer to the online documentation, for instructions on how to complete the installation manually.
Installation completed with errors :expressionless:

Tracking: {‘cocos_installation’: ‘3.16.0’, ‘sdkbox_version’: ‘1.0.1.24’, ‘cocos’: ‘3.16.0’, ‘args’: {‘verbose’: 1, ‘legacy’: None, ‘installer’: ‘C:/MinGW/msys/1.0/home/.sdkbox/bin/sdkbox.pyc’, ‘manifest’: ‘manifest.json’, ‘nopatching’: 0, ‘runin’: None, ‘patcherrors’: 0, ‘project’: ‘D:/MyPojects/Mobile-Games/cymj/build/jsb-binary/’, ‘noupdate’: 0, ‘mvalue’: None, ‘nopatchingcpp’: 0, ‘local’: 0, ‘nohelp’: 0, ‘dryrun’: None, ‘jsonapi’: 0, ‘symbol’: None, ‘mkey’: None, ‘info’: None, ‘remote’: 1, ‘plugin’: u’C:/MinGW/msys/1.0/home/.sdkbox/plugins/sdkbox-anysdk_v2.3.17.1/’, ‘forcecopy’: 0, ‘days’: 10, ‘server’: ‘120.55.89.27:4097/installer/v1/’, ‘forcedownload’: 0, ‘command’: ‘import’, ‘alwaysupdate’: 0}, ‘return_status’: ‘patch_failed’}


#2

sorry, anysdk is out of SDKBox.
As I know, creator contains AnySDK.


#3

If you create a new project with Cocos Creator it should have AnySDK integrated already.