Error cannot resolve symbol loadanimation - animationutils

This code is work in eclipse for Android 4.1
But in Android studio for Android 5.1 i have this error: cannot resolve symbol 'loadanimation '
I import everything, clean project, rebuild, restart.
why is not working? Please help
This is my code:
Animation anim = new AnimationUtils.loadAnimation(MainActivity.This, R.anim.anim)

Animation anim = AnimationUtils.loadAnimation(MainActivity.This, R.anim.anim);
Method is already static, so remove the new keyword.

Related

"help to fix ' error: unable to read property list from file: info.plist

I added Admob Google extension in to my Game Maker 2 project, when I try to test it on xcode for iOS, I am getting the error from xcode : unable to read property list from file: ...
Tried to fiddle around with the build settings in Xcode for plist to make it XML/Binary and same as input but nothing helped.
Made sure that the extensions in game maker have IOS enabled
Tried to clean build folder
Changed Locations: of Derived data to Relative
Looked for similar problems on google and stack overflow, but nothing exactly with the same issue
Below is the code given by Gamemaker
if os_type == os_ios
{
ads_app_id = "ca-app-pub-4724502015965127~5126911475";
banner_id = "ca-app-pub-4337965814269841/5893054134";
interstitial_id = "ca-app-pub-4724502015965127/8852681295";
rewarded_id = "ca-app-pub-4724502015965127/3717109960";
}
else
{
ads_app_id = "ca-app-pub-4337965814269841~8766033395";
banner_id = "ca-app-pub-4337965814269841/5893055122";
interstitial_id = "ca-app-pub-4337965814269841/5893055258";
rewarded_id = "ca-app-pub-4337965814269841/5893055399";
}
GoogleMobileAds_Init(interstitial_id, ads_app_id);
GoogleMobileAds_LoadInterstitial();
interstitial_loaded = false;
error:
unable to read property list from file:
/Users/faisalnaamani/GameMakerStudio2/iOS/GMS2IOS/Pixel_Bricks_iOS/Pixel_Bricks_iOS/Pixel_Bricks_iOS/Supporting
Files/Pixel_Bricks_iOS-Info.plist: The operation couldn’t be
completed. (XCBUtil.PropertyListConversionError error 1.)
The error is happening at Build time
I opened the plist file with ATOM, the one generated by GameMaker Studio when I noticed xcode could not read it. I noticed a bit of code that was causing an error and when I deleted it xcode was able to build. The code is below:
<key>NSAppTransportSecurity</key>\n\r<dict>\n\r
<key>NSAllowsArbitraryLoads</key>\n\r <true/>\n\r
<key>NSAllowsArbitraryLoadsForMedia</key>\n\r <true/>\n\r
<key>NSAllowsArbitraryLoadsInWebContent</key>\n\r <true/>\n\r</dict>
But I am not sure how to fix it to make it look correct. I am afraid if I delete it somehow the code will not be correct. Does anyone have a solution? And how would I fix it from GameMaker.
As Faisal suggested, the file cannot be read if it's malformed.
Trying to open the file with Xcode helped me find the problem: a syntax error. Xcode was very explicit about where the error might be: at line 32.
After fixing the error in another IDE I was able to open the file with Xcode and build/run my app.

ARSessionConfiguration unresolved in Xcode 9 GM

I have created an ARKit project using a beta version of Xcode 9, which I was able to run on my real device without issues.
Yesterday, I upgraded to Xcode 9 GM, and without touching anything, Xcode shows multiple errors, saying it does not know ARSessionConfiguration i.e.:
Use of undeclared type 'ARSessionConfiguration'
and:
Use of undeclared type 'ARWorldTrackingSessionConfiguration'
...for this code:
let session = ARSession()
var sessionConfig: ARSessionConfiguration = ARWorldTrackingSessionConfiguration()
I have imported ARKit and am using the ARSCNViewDelegate in my ViewController.
When opening the project from the beta version of Xcode, it does not show the errors and I can again run the app on my phone.
Any idea how I can fix this?
ARWorldTrackingSessionConfiguration has been deprecated and renamed to ARWorldTrackingConfiguration: See here
Also, ARSessionConfiguration has been deprecated and renamed to ARConfiguration, which is now an abstract base class.
Use AROrientationTrackingConfiguration when you don't want world tracking, instead of using a generic ARConfiguration. Thus:
let configuration = AROrientationTrackingConfiguration()
You can also check if world tracking is supported on a device:
if ARWorldTrackingConfiguration.isSupported {
configuration = ARWorldTrackingConfiguration()
}
else {
configuration = AROrientationTrackingConfiguration()
}
In Xcode 9 GM, looks like ARWorldTrackingSessionConfiguration has been renamed to ARWorldTrackingConfiguration:
https://developer.apple.com/documentation/arkit/arworldtrackingconfiguration
Reference to this change:
https://github.com/markdaws/arkit-by-example/issues/7
ARSessionConfiguration has been renamed to ARConfiguration:
https://developer.apple.com/documentation/arkit/arconfiguration

Strange errors after converting SceneKit sample code to Swift 3

I downloaded Apple's SceneKit sample code (fox.swift) and opened it up on Xcode 8 beta 6.
It asked me to convert the code to Swift 3, which I did.
When I try to run the code on my phone I receive the errors:
Value of type ‘SCNNode’ has no member ‘run’
Value of type ‘SCNNode’ has no member ‘add’
Sample lines where the error occurs:
cameraYHandle.run(actionY)
self.cameraYHandle.add(cameraYAnimation, forKey: nil)
This leads me to three questions:
1) Are the functions 'run' and 'add' gone on SCNNode for Swift 3?
2) If so, what should I replace them with?
3) If so, if so, why didn't Xcode's converter handled them already?
Thank you for your time :)
PS.: It runned well for Mac using Xcode 7.3.
As dan commented, these translations resulted in a code without errors:
run => runAction
add => addAnimation
play => playAudio
so,
cameraYHandle.run(actionY) becomes cameraYHandle.runAction(actionY)
and so on.
Thank you, Dan.

how to write a program or a shell script to remove an existing xxx.framework(not imported from apple's libraries) from my project

system:mac osx 10.11.2 , xcode 7.2
i want to write a program or a shell script to remove/add an existing xxx.framework(not imported from apple's libraries) from my project.
i tried to use XCodeEditor like this:
XCProject *asProject = [[XCProject alloc] initWithFilePath:#"/Users/xxx/Desktop/project/test/testXCodeConfig/AAA.xcodeproj"];
XCTarget *aTarget = [asProject targetWithName:#"ccc"];
XCSourceFile *file = [asProject fileWithName:#"bbb.framework"];
NSLog(#"%d",originTarget.members.count);
[aTarget removeMemberWithKey:file.key];
NSLog(#"%d",aTarget.members.count);
[asProject save];
but it didnt work.i got the same count number printed twice.
anyone knows how to make it?
thanks!

Detected an attempt to call a symbol in system libraries .. when using libclang for ios app

I was able to cross-compile llvm/clang for i386 and i'm trying to use it in my ios app.
Also i was able to add headers and static libs (both libLLVM*.a and libclang*.a) and compile/link the project with no errors.
But when trying to run simple app i'm getting error:
Detected an attempt to call a symbol in system libraries that is not
present on the iPhone: pthread_mutexattr_destroy$UNIX2003 called from
function _ZN4llvm3sys9MutexImplC2Eb in image LibClangUsageDemo3.
What can i do in order to fix it?
Is it llvm/clang issue or i'm doing smth wrong?
Update: i was able to find error line - Mutex.cpp:
// Destroy the attributes
errorcode = pthread_mutexattr_destroy(&attr);
assert(errorcode == 0);

Resources