Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6258] Android:Error inflating class fragment

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2019-07-17T22:54:42.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
Componentsn/a
Labelsandroid, appcelerator, titanium
Reportermbhatt33
AssigneeShak Hossain
Created2019-05-15T12:34:14.000+0000
Updated2019-07-17T22:54:42.000+0000

Description

i am trying to use a fragment using .xml file in appcelerator.but while inflating i am getting the below error [ERROR] : TiExceptionHandler: (main) [184,617] /hyperloop/android.view.LayoutInflater.js:390 [ERROR] : TiExceptionHandler: var result = this.$native.callNativeFunction({ [ERROR] : TiExceptionHandler: ^ [ERROR] : TiExceptionHandler: Error: Binary XML file line #6: Binary XML file line #6: Error inflating class fragment [ERROR] : TiExceptionHandler: at LayoutInflater.inflate (/hyperloop/android.view.LayoutInflater.js:390:28) [ERROR] : TiExceptionHandler: at new Controller (/alloy/controllers/index.js:62:15) [ERROR] : TiExceptionHandler: at Object.exports.createController (/alloy.js:339:9) [ERROR] : TiExceptionHandler: at /app.js:59:7 [ERROR] : TiExceptionHandler: at Module._runScript (ti:/module.js:613:9) [ERROR] : TiExceptionHandler: at Module.load (ti:/module.js:105:7) [ERROR] : TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:457:9) [ERROR] : TiExceptionHandler: at Module.loadAsFile (ti:/module.js:512:15) [ERROR] : TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:429:20) [ERROR] : TiExceptionHandler: at Module.require (ti:/module.js:256:17) [ERROR] : TiExceptionHandler: [ERROR] : V8Exception: Exception occurred at /hyperloop/android.view.LayoutInflater.js:390: Uncaught Error: Binary XML file line #6: Binary XML file line #6: Error inflating class fragment js FIle var OneSDKBuilder = require('com.aol.mobile.sdk.player.OneSDKBuilder'); var OneSDK = require('com.aol.mobile.sdk.player.OneSDK'); const Context = require('android.content.Context'); const Inflater = require('android.view.LayoutInflater'); const View = require('android.view.View'); const Activity = require('android.app.Activity'); const activity = new Activity(Ti.Android.currentActivity); const PlayerFragment = require('com.aol.mobile.sdk.player.view.PlayerFragment'); const Fragment = require('android.app.Fragment'); const inflater = Inflater.cast(activity.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)); const resID = activity.getResources().getIdentifier('activity_player', 'layout', activity.getPackageName()); const view = inflater.inflate(resID, null); // const fragment = new PlayerFragment(); // var fm = activity.getFragmentManager(); // fm.beginTransaction() // .replace(activity.getResources().getIdentifier('frame', 'id', activity.getPackageName()), fragment) // .commit(); new OneSDKBuilder(activity.getApplicationContext()) .create(new OneSDKBuilder.Callback({ onSuccess: function(oneSDK) { // useSDK(oneSDK, playerFragment); console.log("success Creating SDK"); }, onFailure: function(e) { console.log("Error Creating SDK"+ e); }})); $.index.open(); xml file http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/linear">

Comments

  1. Jebun Naher 2019-06-09

    Hi [~mbhatt33], Do you still experience the issue? If yes, Can you share complete trace log? Build your project with the command and share the output: *appc run -l trace* Let us know the update. Thanks!
  2. Rakhi Mitro 2019-06-29

    [~mbhatt33], We have not heard back from you since our last response.I just wanted to follow up with you about this issue? Are you still experiencing this problem? Please let us know if you need more help with this issue.

JSON Source