Using your NSURLResponse(webViewHack) - uiwebview

I now went to put this code check SO into another app and I am getting an error on the line:
if ((self = originalImp(self, _cmd, cf))) {
The build error is:
"Too many arguments to function call, expected 0, have 3"
I am using Xcode 6.2 compiling for iOS 7.1
Thanks
K

You can Disable the check in the Project Build Settings by setting 'Enable strict checking of objc_msgSend Calls' to No.
Has worked for me in similar situations. Filter the Build Settings on the keyword 'strict' to find it easily.

Related

TypeError: Error in invocation of debugger.detach; No matching signature

I'm working on the chrome.debugger Chrome extensions API, here's the simple example:
chrome.debugger.attach(target, "1.2")
chrome.debugger.sendCommand(target, "Input.insertText", { text: "test." })
chrome.debugger.detach(target, "1.2")
And in the last line, I get the error:
VM7521:1 Uncaught TypeError: Error in invocation of debugger.detach(debugger.Debuggee target, optional function callback): No matching signature.
at <anonymous>:1:17
What's the problem here?
I guess I've solved the problem:
chrome.debugger.detach(target)
Instead of
chrome.debugger.detach(target, "1.2")
I noticed this while reading the Chrome extension samples on Github:
chrome-extensions-samples/background.js at e716678b67fd30a5876a552b9665e9f847d6d84b · GoogleChrome/chrome-extensions-samples
It didn't have the "version" argument in the detach so.
Hope this helps.
Close visual studio and open, it should solve your problem

Windows 10 >= 1809 issues with jacob and Word ComObject

we have an old legacy app which uses Java version 1.6 update 45 (jdk-6u45-windows-i586.exe) and Jacob.dll 1.8 (jacob_18.zip), and which cannot be updated :(
Everything was working fine till the latest Windows 10 1809 Update. Since then the comobject behavior seems to have changed and causes an error as well as that the word document cannot be saved anymore. I also tried 19H1 but got the same error.
I could reproduce the issue in java with following code, of course you have to import the Jacob.dll:
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;
import com.jacob.com.Dispatch;
ActiveXComponent oWord = new ActiveXComponent("Word.Application");
oWord.setProperty("Visible", new Variant(true));
Dispatch documents = oWord.getProperty("Documents").toDispatch();
String str_file = "C:/temp/test.rtf";
Dispatch doc = Dispatch.invoke(documents, "Open", Dispatch.Method,
new Object[]{str_file},
new int[1]).toDispatch();
The error I get is:
Exception in thread "main" com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: Open
Description: An unknown COM error has occured.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.invoke(Dispatch.java:267)
at Main.main(Main.java:21)
When I click on the Dispatch errors I only get that it is not a valid line number in com.jacob.com.Dispatch
I know it is not the best day not updating the legacy app itself, but what can I say, it is as it is.
Any ideas what might have changed in Windows >= 1809 or how it can be solved without touching the app?
Thanks
Stephan
Edit:
Dispatch oDocument = Dispatch.call(documents, "Open", str_file).toDispatch(); leads to the same error
I should mention that Word opens, but I am not able to save the file and that the return value is an error
OK, the error is the same which is covered in this post:
Exception from Word.ApplicationClass.Activedocument all of a sudden
So it seems to be a bug in >=1809 and for the moment the only fix is to change/play with the regional settings

Why are Log.d() and Log.v() not printing

I have the following test code in my Activity:
#Override
public void onStart() {
super.onStart();
Log.e(CLASS_NAME, "ERROR onStart()");
Log.w(CLASS_NAME, "WARN onStart()");
Log.i(CLASS_NAME, "INFO onStart()");
Log.d(CLASS_NAME, "DEBUG onStart()");
Log.v(CLASS_NAME, "VERBOSE onStart()");
On the logcat view in Android Studio, it only prints:
02-10 15:56:10.190 6194-6194/org.example.my_app E/MyActivity﹕ ERROR onStart()
02-10 15:56:10.190 6194-6194/org.example.my_app W/MyActivity﹕ WARN onStart()
02-10 15:56:10.190 6194-6194/org.example.my_app I/MyActivity﹕ INFO onStart()
On top of the box, the menu is set to Log level: “Verbose”, and if I go into the menu next to it, choose “Edit filter configuration”, “by Log Level” is also set to “Verbose”. Why are the Log.d() and Log.v() not printing anything? What might I am missing? Any suggestions would be appreciated.
Accepted answer not working
My solution:
when your Log.d is not working then Log.wtf is work
It's working for me, may be this is helpful to other, who find solution
Android Studio filters lines that have already been logged but Log itself may filter some levels when logging. See Log.isLoggable:
The default level of any tag is set to INFO.
(However on many phone it is actually set to DEBUG or VERBOSE.)
Fix For meizu phone
Settings -> Accessibility -> Developer options -> advanced
logging->set "Allow all"
For Meizu MX4(Flyme 6.1.0.0), M2(Flyme 6.1.0.0G), M5(Flyme 6.3.0.0G) :
Settings->Accessibility - > Developer Options -> Performance
optimization -> Advanced logging -> set "Allow all"
Huawei, logcat not showing the log for my app?
For other phone search in "developers options": option "logging" and set "all".
Turn off your Developer Option then Restart Your Phone After that on developer option It definitely works by sure!!
I've faced also to the same issue. Even following the previous answers, I didn't find the way to show logs in the Logcat.
After many tries done on my own, here is the (other) way to get logs shown:
Just selecting "Show only selected application" in the combobox did the job. Priorly, it was "Firebase" which was selected.
Hopefully, you will see your logs ;-)
I was trying everything. From log.d to log.wtf. But nothing worked.
Then I restarted my Android Studio. After that, the debugger started working again.
Hope this helps to someone.
For me the issue was that I had actually disabled the logger buffer in my developer settings so go to Settings -> Developer options -> Logger buffer size and set it to anything that isn't 'off'.
I had similar problem to this one. However in my case the problem was empty first string. It worked in older version of Android Studio, but stopped working in Android Studio ver 5.6 after update.
When I used:
Log.d(string1, string2); in my logging wrapper class,
then whenever string1 was "", the logcat would ignore it. The solution was to add
if(string1 == null || string1 == "") {
string1 = "defaultString";
}
before
Log.d(string1, string2);
I hope this helps anyone with this problem.
This started happening with me in Android Studio 3. I was getting old Log.v's printing, but when I added a new one nothing happened. Ditto with debugger breakpoints.
Cleaning the solution and restarting Android Studio worked for me, but there was a simpler solution.
Disable Instant Run. It seems that Instant Run doesn't recognise new Log.v's or breakpoints.
Along the way I also added Gradle-aware Make to my Run/Debug configuration for the main activity. I don't know whether that was necessary, but I'm keeping it. ([Main Menu] Run -> Edit Configurations...)
i had the same problem. I switched off and on developer options and usb debugging and all logs worked. i also enabled gpu debug layers in developer options(i dont think that helped).

Inconsistence Execution of Watir-Web Driver?

I've written a ruby script to test my application. Sometimes it seems to be executing without any error. When executing the same code next time however, the execution is not working as expected and it throws an error. Why it is behaving like this?
The error:
[remote server] file:///C:/Users/RAGHUN~1/AppData/Local/Temp/webdriver-profile20140818-5504-b2tdgg/extensions/fxdriver#googlecode.com/components/driver_componen
t.js:9470:133:in `FirefoxDriver.prototype.findElementInternal_': Unable to locat
e element: {"method":"tag name","selector":"body"} (Selenium::WebDriver::Error::
NoSuchElementError)
Also to overcome this issue tried Watir::always_locate = true but this is also not working. Am I missing any gem files? Can any one provide a suggestion?
Based on the "unable to locate element" error you're experiencing, if you're using Watir to manipulate the elements then I'd try applying ".wait_until_present" or ".when_present" to see if it's a case of that step in question executing too quickly. Hope that helps! Let us know!
Watir::always_locate = true
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = false
b=Watir::Browser.new:firefox, :profile => profile
This works for me

what can watir's new "alert API" actually do?

I just read that new Watir version (3.1.0) has "support for Alert API". What can I actually do with this API?
Is it meant for dealing with javascript popup windows? If so, what command can I use to click "OK" in popup window? Or how can I read title & text of popup window?
I tried "browser.alert.ok" after updating Watir to 3.1.0 but just got some error message...
(There is not yet any clear documentation about this, and trying to interpret the source code is not my strongest side...)
Alert API is for dealing with JavaScript popups.
browser.alert.ok should work. Could you provide the error message?
I am not sure about getting popup title, but you can get it's text with browser.alert.text
More information: http://watir.github.io/docs/javascript-dialogs/
browser.alert.ok should work. Could you provide the error message?
Sure. First, here is Watir code that I used:
require 'watir'
b = Watir::Browser.start "www.w3schools.com/js/tryit.asp?filename=tryjs_alert"
b.maximize
b.frame(:name, "view").button(:text, "Show alert box").click_no_wait
sleep 2
b.alert.ok
And here is the error message:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
-- control frame ----------
c:0012 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :enum_child_windows
c:0011 p:0065 s:0046 b:0046 l:002478 d:002478 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:319
c:0010 p:0015 s:0038 b:0038 l:0018e4 d:0018e4 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:200
c:0009 p:0025 s:0033 b:0033 l:000032 d:000032 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:147
c:0008 p:0035 s:0025 b:0024 l:000023 d:000023 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:247
c:0007 p:0017 s:0020 b:0020 l:000019 d:000019 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:220
c:0006 p:---- s:0015 b:0015 l:000014 d:000014 FINISH
c:0005 p:0079 s:0013 b:0013 l:000012 d:000012 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialogs/alert.rb:38
c:0004 p:0011 s:0010 b:0010 l:000009 d:000009 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialogs/alert.rb:27
c:0003 p:0107 s:0007 b:0007 l:00043c d:0018c0 EVAL C:/watir_testit/pop.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00043c d:00043c TOP
-- Ruby level backtrace information ----------------------------------------
C:/watir_testit/pop.rb:6:in <main>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialog
s/alert.rb:27:inok'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialog
s/alert.rb:38:in dialog'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:
220:inmethod_missing'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/window.rb:247:in child'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:147:inchild_window_locators'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:200:in control_hwnd'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319:infind_hwnd'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319:in `enum_child_windows'
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Resources