illegalargumentexception

Input byte array has incorrect ending byte at 40

[亡魂溺海] 提交于 2020-06-24 20:54:09
问题 I have a string that is base64 encoded. It looks like this: eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0= Any online tool can decode this to the proper string which is {"bla1":"bla1","bla2":"bla2"} . However, my Java implementation fails: import java.util.Base64; System.out.println("payload = " + payload); String json = new String(Base64.getDecoder().decode(payload)); I'm getting the following error: payload = eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0= java.lang.IllegalArgumentException: Input byte

Input byte array has incorrect ending byte at 40

末鹿安然 提交于 2020-06-24 20:53:47
问题 I have a string that is base64 encoded. It looks like this: eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0= Any online tool can decode this to the proper string which is {"bla1":"bla1","bla2":"bla2"} . However, my Java implementation fails: import java.util.Base64; System.out.println("payload = " + payload); String json = new String(Base64.getDecoder().decode(payload)); I'm getting the following error: payload = eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0= java.lang.IllegalArgumentException: Input byte

Is it possible that onPause() gets called if onResume() hasn't been called before?

蹲街弑〆低调 提交于 2020-06-17 07:57:10
问题 I register receiver in onResume() and unregister it in onPause() method. I can strange error in my Crashlytics reports: Fatal Exception: java.lang.RuntimeException Unable to pause activity {package-here}: java.lang.IllegalArgumentException: Receiver not registered: Caused by java.lang.IllegalArgumentException Receiver not registered: It happened 3 times (3 users) on 20k installs. Is it possible that onPause() gets called if onResume() hasn't been called before? I thought it isn't. 回答1: If it

Is it possible that onPause() gets called if onResume() hasn't been called before?

久未见 提交于 2020-06-17 07:57:08
问题 I register receiver in onResume() and unregister it in onPause() method. I can strange error in my Crashlytics reports: Fatal Exception: java.lang.RuntimeException Unable to pause activity {package-here}: java.lang.IllegalArgumentException: Receiver not registered: Caused by java.lang.IllegalArgumentException Receiver not registered: It happened 3 times (3 users) on 20k installs. Is it possible that onPause() gets called if onResume() hasn't been called before? I thought it isn't. 回答1: If it

Swing apps doesn't run

大憨熊 提交于 2020-05-23 21:36:27
问题 I have a problem in using swing. I don't know what is the cause of this but i'm just trying to create a simple frame app using swing at it give me a lot of error. import javax.swing.JFrame; public class StacksGui { public static void main(String args[]) JFrame frame = new JFrame(); frame.setVisible(true); frame.setSize(100,200); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } Exception in thread "main" java.lang.ExceptionInInitializerError at javax.swing.JPanel.updateUI(Unknown Source

javafx IllegalArgumentException (is already set as root of another scene)

♀尐吖头ヾ 提交于 2020-05-23 12:51:09
问题 I have problem with changing scenes in my application which looks like Main screen > Login screen I am storing screens in main file as hashmap<String, Node> and everything is good until I go back from login screen to main screen and want to load the login screen again, here is exception and code: java.lang.IllegalArgumentException: AnchorPane@30561c33[styleClass=root]is already set as root of another scene public static final HashMap<String, Parent> pages = new HashMap<>(); @FXML private void

View not attached to window manager (whats the solution?)

纵然是瞬间 提交于 2020-03-14 07:40:38
问题 I got hundreads of error reports from my app and all of them is the same. It is really annoying because in my test devices (HTC Wildfire, Galaxy S I-II-III, Galaxy Mini, Galaxy Tab 10) this error NEVER occured, neither to me or my test buddy, looks like users do something different then us. Because of this i cant give you too much information about the situation, there is one thing i see, it is something with a dialog's dismiss, which i actually never calls by code. here is the error: java

Cannot Construct An Image Object With Relative File Path WIthout Using file: Prefix

心已入冬 提交于 2020-03-06 04:20:31
问题 I have been trying to create an image object like this: Image img = new Image("images/jack.png"); or Image img = new Image("jack.png"); or /jack.png or /images/jack.png etc. I have looked up the working directory using System.getProperty("user.dir") and it is indeed where I put my image file. When I use file: prefix, it does work, like so: Image img = new Image("file:images/jack.png"); However, it is also supposed to work without using it. In the textbook it is done without file: . I've seen

Extracting frame from video from storage device using MediaMetadataRetriever - IllegalArgumentException at setDataSource()

杀马特。学长 韩版系。学妹 提交于 2020-03-04 19:35:49
问题 I want to extract one frame from video in my app. The video is chosen from my storage device. After trying to call setDataSource I'm getting an IllegalArgumentException. Here is the part of my code: MediaMetadataRetriever med = new MediaMetadataRetriever(); med.setDataSource(imageUri.toString()); A value of imageUri is: content://com.android.providers.media.documents/document/video%3A59728 Is the path of my video in wrong format? I have also tried to use FFmpegMediaMetadataRetriever. 回答1: use