Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5127] Issue with context since SDK6

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-08-29T19:53:48.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterRainer Schleevoigt
AssigneeShak Hossain
Created2017-08-06T17:16:12.000+0000
Updated2017-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

Comments

  1. Rainer Schleevoigt 2017-08-06

    On JS layout I simple use:
    
       if (Alloy.CFG.development_settings.firebase == true) {
       		const FiBa = require("ti.firebase");
       		FiBa.initFirebaseApp();
       }
       </pre></code>
  2. Rainer Schleevoigt 2017-08-06

    Found this method isDeviceProtectedStorage works only since SDK24. Does it supported by SDK6.1.1.?
  3. Motiur Rahman 2017-08-09

    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
  4. Rainer Schleevoigt 2017-08-09

    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
  5. Motiur Rahman 2017-08-10

    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
  6. Hans Knöchel 2017-08-30

    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!

JSON Source