From the 25th of june two unrelated apps that are using ads started to have this NPE
java.lang.NullPointerException
at zo.a(SourceFile:172)
at aeh.a(SourceFile:120)
at afw.run(SourceFile:14)
at afy.run(SourceFile:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
I think this is related to google play services update. Is anyone able to help me out on this issue?
Just to confirmed that the issue is related to play service I have managed to get this from crashlytics from a thread called AdWorker:
thread
at java.lang.Object.wait(Object.java)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:973)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1282)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
at zo.a(SourceFile:147)
at zo.a(SourceFile:170)
at aeh.a(SourceFile:120)
at afw.run(SourceFile:14)
at afy.run(SourceFile:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
it is not the right place... but there is no place at all where to report them
Number of exceptions it has double from 1 july, it is now almost 3 times what it was the 27th of june.
Issue on android google code project
The discussion is now in this thread on admob google Heading group
Last reply from google "We're aware of these crashes and are working on fixes. We hope to push out these fixes in the next week or two." (July 7th)
Found this solution by Mateusz Matela at https://groups.google.com/forum/#!topic/google-admob-ads-sdk/DkjtCx_Zvn8.
I have tried on a Motorola DEFY+ that crashed from this bug two out of three times. It seems to work even when the warnings assositated with this bug appears in the log. It even says "AdWorker thread thrown an exception". My ads even reappeard when continuing to use the app.
final UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
#Override
public void uncaughtException(Thread thread, Throwable ex) {
if (thread.getName().startsWith("AdWorker")) {
Log.w("ADMOB", "AdWorker thread thrown an exception.", ex);
} else if (defaultHandler != null) {
defaultHandler.uncaughtException(thread, ex);
} else {
throw new RuntimeException("No default uncaught exception handler.", ex);
}
}
});
Today, Google posts this : http://android-developers.blogspot.fr/2014/07/google-play-services-5.html
And now it works for me. Just try again to update the GooglePlayService in your mobile and update your ADT.
Edit :
Code to check GPS version :
// Check if GooglePlay Service is good;
resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this.getActivity());
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, this.getActivity(), 1).show();
rootView = inflater.inflate(R.layout.fragment_googleplayerror, container, false);
return rootView;
} else {
Log.i(Tag, "This device is not supported.");
getActivity().finish();
}
}
I got exactly same errors on different android versions after updating admob to google play services.
I think it can't be solved on user side.
It is related to Play services update, see sample crash log below. Since it crashes onCreate it might be happening when user click on an advert or a specific type of advert
USER_COMMENT=
ANDROID_VERSION=4.1.2
APP_VERSION_NAME=8.9
BRAND=samsung
PHONE_MODEL=GT-I9100
CUSTOM_DATA=
STACK_TRACE=java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxxx/com.google.android.gms.ads.AdActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at acm.a(SourceFile:215)
at acz.onTransact(SourceFile:58)
at android.os.Binder.transact(Binder.java:326)
at com.google.android.gms.internal.ck$a$a.onCreate(Unknown Source)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
... 11 more
java.lang.NullPointerException
at acm.a(SourceFile:215)
at acz.onTransact(SourceFile:58)
at android.os.Binder.transact(Binder.java:326)
at com.google.android.gms.internal.ck$a$a.onCreate(Unknown Source)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
I was seeing the exact same issue with one of my apps since Jun 25th as well. You are right this is a Google issue, I think I have managed to resolve it by updating my Android Support Library to version 20 (I was using android-support-v4.jar) and my Google Play Services to version 17.
I am not sure which of the two revisions resolved this but it's been 24 hours and the Crash reports have stopped.
EDIT:
Sorry this is still not resolved. But I got a response from the AdMod SDK team that they are looking into it. https://groups.google.com/forum/#!topic/google-admob-ads-sdk/DkjtCx_Zvn8
This is a partial solution and it seems (so far) to fix 100% the crashes: you should postpone the ad request a few milliseconds to avoid this crash!
Simplified example:
Handler handler = new Handler() {
#Override
public void handleMessage(Message msg) {
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
super.handleMessage(msg);
}
};
if (handler != null) {
handler.sendEmptyMessageDelayed(0, 200);
}
I have discovered a workaround.
In my case, I was showing the ad from within a service running in a custom process. For example:
<service
android:name="com.example.MyService"
android:exported="false"
android:process=":svc"
/>
In my AndroidManifest.xml, I then set the same android:process attribute for the declared AdActivity, and the problem went away.
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:process=":svc"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>
In the case of my application, I don't particularly care which process the ad activity runs in, so this workaround is sufficient. Hopefully this will be of some use to others.
I have find temporary semi-solution. I use thiagolr advice above with delayed ad request:
Handler handler = new Handler() {
#Override
public void handleMessage(Message msg) {
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
super.handleMessage(msg);
}
};
if (handler != null) {
handler.sendEmptyMessageDelayed(0, 200);
}
Also I removed onResume and onPause methods, so I don't know which solution helps me,
but beforee this workaround I had 100-130 java.lang.NullPointerException at zo.a(SourceFile:172) per day. After this workaround I had 6-10 NullPointerException per day. If you want you could try this solutions separately to define which of them helps.
My removed methods in activity:
// #Override
// public void onPause() {
// adView.pause();
// super.onPause();
// }
//
// #Override
// public void onResume() {
// super.onResume();
// adView.resume();
// }
According to: https://groups.google.com/forum/#!topic/google-admob-ads-sdk/DkjtCx_Zvn8
Some have had a success by adding android:theme="#android:style/Theme.Translucent" to activity android:name="com.google.android.gms.ads.AdActivity" in the manifest.
I'm rolling out a new version with that fix now. Will see in a couple of days if it helps.
Move to using other ad sdk. I tried most of the thing mentioned and error still remains.
And i personally hate applying such hacks in code. So decided to switch rather using google ad sdk with crashes and bugs.
Related
I am using version 1.2.1 (tried with latest version 1.2.2) of android's youtube player api. It works fine on most of the devices. However now and then, I keep on getting crashes on crashlytics. I am getting the following crashes
Fatal Exception: java.lang.IllegalStateException: android.os.TransactionTooLargeException
at com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.x(SourceFile:558)
at bpd.w(SourceFile:576)
at tef.onTransact(SourceFile:390)
at android.os.Binder.transact(Binder.java:395)
at com.google.android.youtube.player.internal.d$a$a.r(Unknown Source)
at com.google.android.youtube.player.internal.s.h(Unknown Source)
at com.google.android.youtube.player.YouTubePlayerView.e(Unknown Source)
at com.google.android.youtube.player.YouTubePlayerSupportFragment.onSaveInstanceState(Unknown Source)
at android.support.v4.app.Fragment.performSaveInstanceState(Fragment.java:1936)
at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1654)
at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:1722)
at android.support.v4.app.Fragment.performSaveInstanceState(Fragment.java:1938)
at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1654)
at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:1722)
at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:527)
at com.newshunt.news.activities.NewsBaseActivity.onSaveInstanceState(NewsBaseActivity.java:56)
at com.newshunt.news.activities.NewsDetailsActivity.onSaveInstanceState(NewsDetailsActivity.java:613)
at android.app.Activity.performSaveInstanceState(Activity.java:1388)
at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1286)
at android.app.ActivityThread.callCallActivityOnSaveInstanceState(ActivityThread.java:4588)
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3960)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4023)
at android.app.ActivityThread.access$1200(ActivityThread.java:181)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Also getting crashes for the following exception.
Fatal Exception: java.lang.IllegalStateException: android.os.DeadObjectException
at com.google.android.apps.youtube.api.jar.a.eo.surfaceDestroyed(SourceFile:236)
at android.view.SurfaceView.updateWindow(SurfaceView.java:589)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:237)
at android.view.View.dispatchDetachedFromWindow(View.java:12854)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2757)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2757)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3844)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3819)
at android.view.ViewGroup.removeView(ViewGroup.java:3751)
at com.google.android.youtube.player.YouTubePlayerView$1.b(Unknown Source)
at com.google.android.youtube.player.internal.r.h(Unknown Source)
at com.google.android.youtube.player.internal.r$e.onServiceDisconnected(Unknown Source)
at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1111)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1125)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5317)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(NativeStart.java)
The crash happens to appear in specific versions of youtube application like 5.2.27. Although there are a lot of issues filed for these crashes, there has been no reply from the youtube developers on how to mitigate this issue.
Some of the fellow developers have suggested the following workarounds
1) Use loadVideo instead of cueVideo. But I cannot use this workaround because loadVideo always autoplays the video which is not a requirement of my application. Also someone mentioned that with loadVideo also, this problem is happening although in some different version.
2) Put check in the code to check the youtube application version and then put the specific code. Now the problem with this approach is that I have to check each and every version of youtube app ever released and check which versions are causing the issue which is not a good workaround.
Now is there any fix which I can apply to avoid this issue or are the youtube developers planning to release some jar which internally takes care of all these issues?
I reduced the bug occurrence by putting youtube calls (like youtubePlayer.loadVideo(), cueVideo(), getCurrentTimeMillis() etc.) in a try catch block and catch the IllegalStateException exception then reinitialize youtube player.
To create a new instance of the YoutubePlayer just call the initialize() method in the catch block.
Example:
if (youtubePlayer != null) {
try {
youtubePlayer.loadVideo(videoId);
} catch (IllegalStateException e) {
initialize(API_KEY, this);
}
}
but the bug still occurred , I worked around it by catching these exceptions and restart activity. This uncaught exceptions and to catch them you need to use UncaughtExceptionHandler
example :
private Thread.UncaughtExceptionHandler defaultUEH;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
// setup handler for uncaught exception
Thread.setDefaultUncaughtExceptionHandler(_unCaughtExceptionHandler);
}
private Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
new Thread.UncaughtExceptionHandler() {
#Override
public void uncaughtException(Thread thread, Throwable ex) {
Log.e(TAG, "uncaughtException: ", ex);
PendingIntent myActivity = PendingIntent.getActivity(getApplicationContext(),
192837, new Intent(getApplicationContext(), MainActivity.class),
PendingIntent.FLAG_ONE_SHOT);
AlarmManager alarmManager;
alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
15000, myActivity );
System.exit(2);
// re-throw critical exception further to the os (important)
defaultUEH.uncaughtException(thread, ex);
}
};
The android YouTube Player API is not stable, there are known bugs in it. The team from YouTube said that they will release a new version of the library.
For now, the best solution I have found is to build my own library.
I am using Ionic framework to build the hybrid Android app and the app works fine. I am using Fabric Crash analytics plugin and its reporting the crashes of the app.
I am getting the below crash details very often and not sure what's the reason for the same. I am not sure what would be the starting point to start analysizing this.
Fatal Exception: java.lang.NullPointerException
at android.webkit.WebViewClassic.setNetworkAvailable(WebViewClassic.java:4224)
at android.webkit.WebView.setNetworkAvailable(WebView.java:731)
at org.apache.cordova.engine.SystemWebViewEngine$1.setNetworkAvailable(SystemWebViewEngine.java:112)
at org.apache.cordova.NativeToJsMessageQueue$OnlineEventsBridgeMode$2.run(NativeToJsMessageQueue.java:340)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5319)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(NativeStart.java)
Is it related to any plugin or any issue in Ionic or Cordvoa? Any help or advise would be helpful.
I have the same problem. I also use Cordova and Fabric Crashlytics.
It's reproduced only on Android 4.1.2, 4.2.2, 4.3.
I have reproduced the bug:
open WebView with content that contain javascript functions;
open new WebView and close it;
disable network (wifi and mobile) as soon as possible;
return to app and show stacktrace.
I found a solution:
I'm not using CordovaActivity in my app. I'm using CordovaInterface.
PluginManager associated with deleted WebView continues to call its methods. So I manual call WebView.handleDestroy() to destroy PluginManager.
In my Fragment:
#Override
public void onDestroy()
{
if (webView != null)
{
webView.handleDestroy();
webView.destroy();
webView = null;
}
super.onDestroy();
}
Update:
It's reproduced when you destroy WebView, but PluginManager continues to live and sends javascripts events to subscribers (WebViews). Because I call WebView.handleDestroy().
You could swallow the exception? Edit this file:
/platforms/android/CordovaLib/src/org/apache/cordova/engineChange/SystemWebViewEngine.java
And change this
webView.setNetworkAvailable(value);
to this
import java.lang.NullPointerException;
...
try {
webView.setNetworkAvailable(value);
}
catch (NullPointerException e) {
Log.d(TAG, "webView.setNetworkAvailable called after destroy");
}
Not really a solution, but given the difficulty in reproducing locally, it may be an option to consider.
My solution was in SystemWebViewEngine.java.
change protected final SystemWebView webView; to protected SystemWebView webView;
in destroy() method after
if (receiver != null)
{
try
{
webView.getContext().unregisterReceiver(receiver);
}
catch (Exception e)
{
Log.e(TAG, "Error unregistering configuration receiver: " + e.getMessage(), e);
}
}
add
webView = null;
Replace webView.setNetworkAvailable(value); with
if (webView != null)
webView.setNetworkAvailable(value);
I'm showing an interstitial at the end of a game level. When the user presses the Back button very quickly, a crash sometimes occurs:
java.lang.IllegalStateException
at android.media.MediaPlayer.getDuration(Native Method)
at com.google.android.gms.ads.internal.overlay.l.a(SourceFile:180)
at com.google.android.gms.ads.internal.overlay.n.run(SourceFile:204)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
I'm using the latest version of Google Play Services (v25). The code for showing Admob interstitial is already inside a try-catch block, but this doesn't help.
Is there a way to prevent that crash?
Are you sure your try catch block has caught IllegalStateException ?
try{
}catch(IllegalStateException e){
}
if not you must catch illegalStateException
There is no way to catch the exception.
It is thrown from the UI thread with none of your code in the stack.
It will undoubtedly be fixed by Admob in the near future.
Following the suggestions provided in this question I modified my AdMob code to be compliant with the recommendations, that effectively worked reducing the number of exceptions that were appearing. However a new exception is rising.
The code is the following:
#Override
protected void onDestroy() {
if ( adView != null ) {
adView.destroy();
adView = null;
Log.i(ApplicationData.APP_TAG, TAG + ": OnDestroy, destroying the Adview");
}
super.onDestroy();
}
The method adView.destroy() appears to work well as the LogCat message is published. Just after this message I am getting the following exception on WebView:
java.lang.NullPointerException
at android.webkit.WebViewClassic.loadDataWithBaseURL(WebViewClassic.java:2741)
at android.webkit.WebView.loadDataWithBaseURL(WebView.java:919)
at com.google.android.gms.ads.internal.request.n.run(SourceFile:206)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5297)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Unfourtunately I am not able to find a way to reproduce the problem but is happening in production regularly. I have not been able to find any problem, has somebody any hint of what I can do?
One of Google Mobile Ads SDK Team said (March 14),
We looked into this issue when it was first reported, and a fix has been released within Google Play services. You should see fewer and fewer instances as your users' devices update to the new version.
Refer to https://groups.google.com/forum/#!topic/google-admob-ads-sdk/oYpQI_L14Tg
This occurs when the WebView is destroyed before loadDataWithBaseUrl is called( probably by other thread). In AdMob code, i saw that they handle this now as follows
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) {
synchronized(this) {
if(!this.isDestroyed()) {
super.loadDataWithBaseURL(baseUrl, data, mimeType, encoding, historyUrl);
} else {
Log.d("The webview is destroyed. Ignoring action.");
}
}
}
So it should not occur now.
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.os.Parcel.readException(Parcel.java:1328)
at android.os.Parcel.readException(Parcel.java:1276)
at com.android.vending.billing.IMarketBillingService$Stub$Proxy.sendBillingRequest(IMarketBillingService.java:100)
at kr.my.dungeons.BillingService$CheckBillingSupported.run(BillingService.java:209)
at kr.my.dungeons.BillingService$BillingRequest.runIfConnected(BillingService.java:127)
at kr.my.dungeons.BillingService.runPendingRequests(BillingService.java:609)
at kr.my.dungeons.BillingService.onServiceConnected(BillingService.java:654)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1049)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1066)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:126)
at android.app.ActivityThread.main(ActivityThread.java:4002)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
That is error syntax.
Get sample source from SDK.
Put 'public key' in Security.java from google market.
My source path is 'src/kr/my/' and aidl file path is 'src/com/android/vending/billing/'.
Checked AndroidManifest.xml.
Upload apk to google market. (not published)
add 'sword_001', 'potion_001' in google market.(published)
Installed same apk on device.
(same error in sample source from https://github.com/robotmedia/AndroidBillingLibrary)
What Did I mistake?
This happens when the user has not accepted the Market EULA
So launch the EULA
try {
CALL BILLING CODE HERE .....
} catch (NullPointerException e) {
initialiseMarket();
}
private void initialiseMarket() {
new AlertDialog.Builder(this).
setTitle("Android Market").
setNeutralButton("CLOSE"), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search"));
startActivity(intent);
}
}).
setMessage("Android Market not initialised. Please accept EULA and restart.").
show();
}
Taken from here
I'm working on fixing this here https://github.com/drewjw81/AndroidBillingLibrary
This version should display an alert when it can't bind to Play correctly.
If you use it, remember it still needs some work so please test, also please file a bug report on my page if the error still occurs.
This appears to be a known In-App Billing bug reported here.
I've added a catch to the AndroidBillingLibrary when this occurs.
Read my answer here:
android in-app billing - restoreTransactionInformation
I'm assuming you tried to restore transactions because a bunch of users (including me) were seeing this stack trace while doing so.
The error occurs because of a null field (the 'notification_id' field) added to the CONFIRM_TRANSACTIONS request sent back when you call a restoreTransactions.