Building a jni lib for tux rider android application

匆匆过客 提交于 2019-12-11 05:58:10

问题


I've downloaded drodin's android app "Tux rider" source code, in order to build it my self. https://github.com/drodin/TuxRider

in the application, there's a call for a library called "tuxrider"

System.loadLibrary("tuxrider");

but there's no such library, and I'm not managing to figure out how to build one from all the files there.


回答1:


There seem to be build scripts for that library in TuxRider/jni/tuxrider. You'll probably need to download Android NDK (http://developer.android.com/sdk/ndk/index.html) and read this page to build it: http://developer.android.com/sdk/ndk/overview.html




回答2:


Finally I menaged to solve a problem. It was caused by GoogleAds, not by tuxrider library. Simply, comment all mentioning of GoogleAds in MainActivity.java. That includes:

//import com.google.ads.AdRequest;
//import com.google.ads.AdSize;
//import com.google.ads.AdView;
...
//  private static AdView mAdView = null;
...
//      mAdView = new AdView(this, AdSize.BANNER, "a14d3678cfc9fb7");

//      AdRequest adRequest = new AdRequest();
//      adRequest.addTestDevice(AdRequest.TEST_EMULATOR);

//      mAdView.loadAd(adRequest);
//      mAdView.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL);
...
//      mFrameLayout.addView(mAdView, new LayoutParams(
//              LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
...
//          if (mAdView != null) {
//              mAdView.setVisibility(View.VISIBLE);
//          }
...
//          if (mAdView != null) {
//              mAdView.setVisibility(View.INVISIBLE);
//          }

After this, all should work fine. Chears!



来源:https://stackoverflow.com/questions/5620059/building-a-jni-lib-for-tux-rider-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!