Closed genericjohndoe closed 6 years ago
@genericjohndoe can you show app/build.gradle
?
apply plugin: 'com.android.application'
/*apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'*/
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.udacity.gradle.builditbigger"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resConfigs "auto"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
}
configurations.all {
resolutionStrategy.eachDependency { details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.1.0'
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//circular imageview
compile 'de.hdodenhof:circleimageview:2.2.0'
//dialog boxes
compile 'com.afollestad.material-dialogs:core:0.9.4.7'
//chips library
compile project(path: ':chipslibrary')
//Firebase
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.firebaseui:firebase-ui-auth:3.2.2'
compile 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
//support library
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:design:27.1.0'
//lifecycle aware objects
implementation "android.arch.lifecycle:runtime:1.1.0"
annotationProcessor "android.arch.lifecycle:compiler:1.1.0"
implementation "android.arch.lifecycle:common-java8:1.1.0"
//testing
compile 'com.google.code.findbugs:jsr305:3.0.1'
testCompile 'junit:junit:4.12'
//glide
compile 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
//splash screen
compile 'agency.tango.android:material-intro-screen:0.0.5'
//floating action menu
compile 'com.github.clans:fab:1.6.4'
//video playback
compile 'com.google.android.exoplayer:exoplayer:r2.5.1'
compile 'com.google.android.exoplayer:extension-mediasession:r2.5.1'
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.0"
annotationProcessor "android.arch.lifecycle:compiler:1.1.0"
// Room
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
//kapt "android.arch.persistence.room:compiler:1.0.0"
//vid chat
compile 'co.netguru.videochatguru:videochatguru:0.1.2@aar'
implementation 'org.webrtc:google-webrtc:1.0.+'
//socialtextview
compile 'com.hendraanggrian:socialview-core:0.17'
compile 'com.hendraanggrian:socialview-commons:0.17'
//gif support
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.10'
//multidex
compile 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
@samtstern
@samtstern the error is on line 29 in xml according to the error message. I tried moving around the elements in the xml docs for the layouts down. each time the app failed, but the line number didn't change, why?
@genericjohndoe I apologize for my lack of response, I am pretty stumped on the cause of this issue and have not been able to think of a next step. But I'll try to take another look.
@genericjohndoe Could you please try removing the configurations.all
block? That's not how you should be setting dependencies... 😕
@SUPERCILEX i removed the configurations.all block, it didnt solve my problem but the project builds without error
@samtstern so i've traced the error to:
public static Intent createIntent(Context context, FlowParameters flowParams) {
return HelperActivityBase.createBaseIntent(
context, AuthMethodPickerActivity.class, flowParams);
}
When the intent is returned from HelperActivityBase.createBaseIntent()
, that's when the application terminates. I'm not sure what to do from there though.... None of the methods of the AuthMethodPickerActivity
or the HelperActivityBase
classes are being called (including onCreate()
, which means setContentView()
isn't being called). What could explain the error received when layouts aren't being inflated yet?
I logged every method starting from the KickOffActivity
class (The beginning of methods, the end of methods, before and after super()
(if applicable), a log statement was put in every conditional block as well. The last log statement observed was the one I put in the HelperActivityBase.createBaseIntent()
method, which was right before the return statement. Note: this was after AuthMethodPickerActivity.createIntent()
was called....
Hmmm, yeah, I'm stumped too. Thanks a ton for your investigation! However, creating an intent basically just tells Android what "component" aka activity, broadcast receiver etc to use for an action. If you put a breakpoint in the KickoffActivity
's onCreate
super call, that's where all the magic will happen. So this AppCompat line is causing the problem:
subDecor = (ViewGroup) inflater.inflate(
R.layout.abc_dialog_title_material, null);
That doesn't make any sense since it's a standard layout call. If I had to guess, one of your dependencies is destroying AppCompat somehow... the best advice I can offer is ripping everything apart with only FirebaseUI left over, then slowly adding back your dependencies until AppCompat breaks. Once that happens, you can send the 😡 emoji to the maintainer of that library. 😆 (Just kidding, don't do that 😉)
I have the same issue. The most interesting thing is that one of my dependencies in build.gradle
is probably the same. It is the implementation of com.github.pchmn:MaterialChipsInput
library imported as a module and named as chipslibrary
in your case. No doubt, it causes the problem, because if you delete it, the problem will disappear. Does anyone have an idea why it happens? How can one library cause an error in another?
@pavel-zolotov thanks for the input! Sounds like that library is the issue? And it's compiled from a module (compile project(path: ':chipslibrary')
) which means it's going to be tricky to root out the issue.
@genericjohndoe do you get this issue if you remove that library?
@samtstern I ended up removing the firebase UI library. i set up my own login/sign in UI. things seem to work fine now
@genericjohndoe well that's one way to solve it :cry: but I wish you didn't have to! We'll keep trying to fix it, good luck with your app!
I have spent a ton of hours until I came up with a solution. The problem was caused by a conflict of dependencies, that use both of chipslibrary
and firebase-ui-auth
. Most probably there are different versions of one of the support libs. So I solved the problem by using implementation project(':chipslibrary')
with implementation 'com.android.support:appcompat-v7:27.1.0'
in my build.gradle
instead of compile project(':chipslibrary')
and compile 'com.android.support:appcompat-v7:27.1.0'
@samtstern I don't think we'll be able to do anything about this problem on our side aside from telling developers to use aars instead of jars.
Thanks for following up @pavel-zolotov! And @SUPERCILEX I agree, it's unfortunate but we can't do much here. Closing the issue to reflect that.
FATAL EXCEPTION: main
Process: com.guru.androidtv, PID: 30155
android.view.InflateException: Binary XML file line #42 in com.guru.androidtv:layout/lb_playback_transport_controls_row: Binary XML file line #42 in com.guru.androidtv:layout/lb_playback_transport_controls_row: Error inflating class
package com.guru.androidtv.player
import android.net.Uri import android.os.Bundle import androidx.leanback.app.VideoSupportFragment import androidx.leanback.app.VideoSupportFragmentGlueHost
class VideoFragment : VideoSupportFragment() {
private lateinit var transportGlue: CustomTransportControlGlue
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
transportGlue = CustomTransportControlGlue(
context = requireContext(),
playerAdapter = BasicMediaPlayerAdapter(requireContext())
)
transportGlue.host = VideoSupportFragmentGlueHost(this)
transportGlue.subtitle = "Leanback artist"
transportGlue.title = "Leanback team at work"
val uriPath =
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
transportGlue.playerAdapter.setDataSource(Uri.parse(uriPath))
}
}
package com.guru.androidtv.player
import android.content.Context import androidx.leanback.media.PlaybackTransportControlGlue import androidx.leanback.widget.Action import androidx.leanback.widget.ArrayObjectAdapter import androidx.leanback.widget.PlaybackControlsRow
class CustomTransportControlGlue(context: Context, playerAdapter: BasicMediaPlayerAdapter) :
PlaybackTransportControlGlue
private val forwardAction = PlaybackControlsRow.FastForwardAction(context)
private val rewindAction = PlaybackControlsRow.RewindAction(context)
private val nextAction = PlaybackControlsRow.SkipNextAction(context)
private val previousAction = PlaybackControlsRow.SkipPreviousAction(context)
init {
isSeekEnabled = true
}
override fun onCreatePrimaryActions(primaryActionsAdapter: ArrayObjectAdapter) {
primaryActionsAdapter.add(previousAction)
primaryActionsAdapter.add(rewindAction)
super.onCreatePrimaryActions(primaryActionsAdapter)
primaryActionsAdapter.add(forwardAction)
primaryActionsAdapter.add(nextAction)
}
override fun onActionClicked(action: Action) {
when(action){
forwardAction -> playerAdapter.fastForward()
rewindAction -> playerAdapter.rewind()
else -> super.onActionClicked(action)
}
onUpdateProgress()
}
}
package com.guru.androidtv.player
import android.content.Context import androidx.leanback.media.MediaPlayerAdapter import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_ import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_FAST_FORWARD import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_PLAY_PAUSE import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_REWIND import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_NEXT import androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_PREVIOUS
class BasicMediaPlayerAdapter(context: Context) : MediaPlayerAdapter(context) {
val playList = ArrayList<String>()
var playListPosition = 0
override fun next() {
super.next()
}
override fun previous() {
super.previous()
}
override fun fastForward() {
seekTo(currentPosition + 10_000)
}
override fun rewind() {
seekTo(currentPosition - 10_000)
}
override fun getSupportedActions(): Long {
return (ACTION_SKIP_TO_PREVIOUS xor ACTION_REWIND xor ACTION_PLAY_PAUSE xor ACTION_FAST_FORWARD xor ACTION_SKIP_TO_NEXT).toLong()
}
fun loadMovies() {
}
}
Step 1: Are you in the right place?
yes
Step 2: Describe your environment
Step 3: Describe the problem:
I recieved the following error upon start up
Unable to start activity ComponentInfo{com.udacity.gradle.builditbigger/com.firebase.ui.auth.KickoffActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView
Steps to reproduce:
Observed Results:
03-09 16:04:12.294 18290-18290/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.udacity.gradle.builditbigger, PID: 18290 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.udacity.gradle.builditbigger/com.firebase.ui.auth.KickoffActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) Caused by: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class TextView Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x7f040077 a=4 r=0x7f06002c} at android.content.res.TypedArray.getColorStateList(TypedArray.java:545) at android.widget.TextView.<init>(TextView.java:1137) at android.widget.TextView.<init>(TextView.java:1038) at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:75) at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:71) at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103) at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1024) at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1081) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734) at android.view.LayoutInflater.rInflate(LayoutInflater.java:865) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828) at android.view.LayoutInflater.inflate(LayoutInflater.java:525) at android.view.LayoutInflater.inflate(LayoutInflater.java:427) at android.view.LayoutInflater.inflate(LayoutInflater.java:378) at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:383) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323) at android.support.v7.app.AppCompatDelegateImplV9.onPostCreate(AppCompatDelegateImplV9.java:170) at android.support.v7.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:97) at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1207) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2975) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) 03-09 16:04:13.142 18330-18330/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.udacity.gradle.builditbigger, PID: 18330 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.udacity.gradle.builditbigger/com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity}: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x7f040077 a=4 r=0x7f06002c} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x7f040077 a=4 r=0x7f06002c} at android.content.res.TypedArray.getColorStateList(TypedArray.java:545) at android.widget.TextView.<init>(TextView.java:1137) at android.widget.TextView.<init>(TextView.java:1038) at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:75) at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:71) at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:67) at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:753) at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261) at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243) at android.support.v7.widget.ActionBarOverlayLayout.setWindowTitle(ActionBarOverlayLayout.java:621) at android.support.v7.app.AppCompatDelegateImplV9.onTitleChanged(AppCompatDelegateImplV9.java:631) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onCreate(AuthMethodPickerActivity.java:84) at android.app.Activity.performCreate(Activity.java:6977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Expected Results:
Relevant Code: