Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 8.0 app crash when built via Phonegap #138

Open
SurionAndrew opened this issue Apr 26, 2019 · 0 comments
Open

Android 8.0 app crash when built via Phonegap #138

SurionAndrew opened this issue Apr 26, 2019 · 0 comments

Comments

@SurionAndrew
Copy link

So I have read through various issues and tried various solutions, but now its finally time to create an account and ask for help.

I am currently using Phonegap 6.5.0 and desperately trying to get push notifications to work.
below is the debug from logcat when the app crashes. As a note it does work on IOS, I do have a feeling its because ParsePushApplication.java is not called? But I have only been working woth phonegap/cordova for a week or so and am very noob :)

2019-04-26 09:57:57.291 11326-11573/com.phonegap.helloworld E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2
Process: com.phonegap.helloworld, PID: 11326
java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference
at com.parse.ParseCorePlugins.getCurrentInstallationController(ParseCorePlugins.java:273)
at com.parse.ParseInstallation.getCurrentInstallationController(ParseInstallation.java:53)
at com.parse.ParseInstallation.getCurrentInstallation(ParseInstallation.java:59)
at github.taivo.parsepushplugin.ParsePushPlugin$1.run(ParsePushPlugin.java:88)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

Here is the html

`

<title>Blank App</title> <script type="text/javascript" src="cordova.js"></script>
   <script type="text/javascript">
	 window.onload =  onLoad();

    function onLoad() {
    	document.writeln("Waiting for device ready");
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // device APIs are available
    //
    function onDeviceReady() 
    {
    	document.writeln("device Ready");
        // Now safe to use device APIs
        // onLoad();
        pushFunctions();
    }
    
	function pushFunctions()
	{
	   if(window.ParsePushPlugin){
	   	 document.writeln("Get installation ID");
	      window.ParsePushPlugin.getInstallationId(function(id) {
	         // note that the javascript client has its own installation id,
	         // which is different from the device installation id.
	         document.writeln("device installationId: " + id);
	          // alert("device installationId: " + id);
	      }, function(e) {
	        //  alert('error');
	          document.writeln("device installationId: error");
	      });
	 
	   }
	   else
	   {
	         document.writeln("window.ParsePushPlugin error");
	   }

	}


   </script>
</body>
` And the accompanying config.xml

`

TEST

A blank PhoneGap app.


PhoneGap Team





<platform name="android">
    <preference name="android-minSdkVersion" value="15" />
    <preference name="android-targetSdkVersion" value="28" />
</platform>
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant