[AC-5127] Issue with context since SDK6
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2017-08-29T19:53:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Rainer Schleevoigt |
Assignee | Shak Hossain |
Created | 2017-08-06T17:16:12.000+0000 |
Updated | 2017-08-30T08:49:49.000+0000 |
Description
Inside Firebase module this line will called:
FirebaseApp.initializeApp(ctx, firebaseOptions);
This ran under SDK5, but now it crashes with:
[WARN] : W/System.err: java.lang.NoSuchMethodError: No static method isDeviceProtectedStorage(Landroid/content/Context;)Z in class Landroid/support/v4/content/ContextCompat; or its super classes (declaration of 'android.support.v4.content.ContextCompat' appears in /data/app/io.mobilelearning.learn.mla-1/base.apk)
[WARN] : W/System.err: at com.google.firebase.FirebaseApp.zza(Unknown Source)
[WARN] : W/System.err: at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
[WARN] : W/System.err: at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
For ctx I tested unsuccesfully with ctx from onCreateApp, TiApplication.getInstance().getBaseContext();
and getActivity().getApplicationContext();
It seams in relation Landroid/support/v4/content/ContextCompat
.
I have tested with a lot of versions of google service stuff.
Here the project: https://github.com/AppWerft/Ti.Firebase
On JS layout I simple use:
Found this method
isDeviceProtectedStorage
works only since SDK24. Does it supported by SDK6.1.1.?Hello [~titanium@webmasterei-hamburg.de], Ti.Firebase is a third party module so contact with the module owner for any issue. Now Appcelerator latest SDK version is 6.1.2.GA and it supports Android API 24. Thanks
Now I have installed sdk6.2.0.* from edge and API24. Its weird, but this is now the error message if I try to get the context (a problem before I call thirdparty stuff) [WARN] : W/System.err: java.lang.NoSuchMethodError: No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/io.mobilelearning.learn.mla-2/base.apk) I tested this ways to get context: TiApplication.getInstance().getBaseContext(); TiApplication.getAppCurrentActivity().getApplicationContext(); and inside onAppcreate: @Kroll.onAppCreate public static void onAppCreate(TiApplication _app) { ctx = _app.getInstance().getBaseContext(); } all the same issue with
cannot getAppCurrentActivity
…Hello! You should use the latest tested version of Ti SDK and that is 6.1.2.GA. You can get it using this command - appc ti sdk install latest - appc use latest - appc setup Also, this is not our Appcelerator official module so contact with the module owner for the issue. Thanks
Hey Rainer, this is the same issue as in TIMOB-25206 and we just tracked it down to an SDK-regression. It will be fixed in 6.2.0.GA!