Building a jni lib for tux rider android applictio

2019-07-23 08:18发布

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.

Thanks in advance for any suggestions.

2条回答
倾城 Initia
2楼-- · 2019-07-23 09:09

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

查看更多
ら.Afraid
3楼-- · 2019-07-23 09:10

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!

查看更多
登录 后发表回答