0

Here is the stack trace:

06/26 15:42:08: Launching app
$ adb shell am start -n "com.virtual.ai/com.virtual.ai.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 19346 on device oneplus-oneplus_a6010-eb048141
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/m.Karbi.chonan: The ClassLoaderContext is a special shared library.
W/ActivityThread: Application com.virtual.ai can be debugged on port 8100...
I/Perf: Connecting to perf service.
V/FA: Registered activity lifecycle callback
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
    com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
E/libc: Access denied finding property "vendor.debug.egl.profiler"
    Access denied finding property "vendor.debug.prerotation.disable"
W/com.virtual.ai: type=1400 audit(0.0:141094): avc: denied { read } for comm=45474C20496E6974 name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=22713 scontext=u:r:untrusted_app:s0:c88,c257,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
V/FA: Collection enabled
V/FA: App package, google app id: com.virtual.ai, 1:621374270923:android:1dc713bff6faa7cc
V/FA: onActivityCreated
I/FA: App measurement is starting up, version: 16250
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.virtual.ai
D/FA: Debug-level message logging enabled
W/m.virtual.ai: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/m.virtual.ai: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.virtual.ai, PID: 19346
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.virtual.ai/com.virtual.ai.MainActivity}: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class info.hoang8f.widget.FButton
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6863)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class info.hoang8f.widget.FButton
     Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class info.hoang8f.widget.FButton
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.virtual.ai.MainActivity.onCreate(MainActivity.java:20)
        at android.app.Activity.performCreate(Activity.java:7149)
        at android.app.Activity.performCreate(Activity.java:7140)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6863)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x5
        at android.content.res.TypedArray.getColor(TypedArray.java:501)
        at info.hoang8f.widget.FButton.parseAttrs(FButton.java:116)
        at info.hoang8f.widget.FButton.<init>(FButton.java:52)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:647) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at com.virtual.ai.MainActivity.onCreate(MainActivity.java:20) 
        at android.app.Activity.performCreate(Activity.java:7149) 
        at android.app.Activity.performCreate(Activity.java:7140) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6863) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
W/OPDiagnose: getService:OPDiagnoseService NULL
D/OSTracker: OS Event: crash
I/Process: Sending signal. PID: 19346 SIG: 9
Application terminated.

Should I make some changes here? The error I get is related with the built version.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.virtual.ai"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.firebase:firebase-core:10.2.0'
    implementation 'com.google.firebase:firebase-database:10.2.0'
    implementation 'info.hoang8f:fbutton:1.0.5'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.firebaseui:firebase-ui-database:1.2.0'
    implementation 'com.android.support:design:26.+'
    implementation "com.google.android.material:material:1.0.0"
    implementation "androidx.recyclerview:recyclerview:1.0.0"
    implementation "androidx.cardview:cardview:1.0.0"

}
apply plugin: 'com.google.gms.google-services'

Here is the main_activity.xml code:

<LinearLayout
    android:layout_width="368dp"
    android:layout_height="583dp"
    android:layout_centerInParent="true"
    android:orientation="vertical">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:contentDescription="@string/des"
        android:src="@drawable/logo" />

    <TextView
        android:id="@+id/txtSlogan"
        android:layout_width="match_parent"
        android:layout_height="211dp"
        android:gravity="center"
        android:text="@string/slogan"
        android:textColor="@android:color/white" />


</LinearLayout>


<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="85dp"
    android:layout_alignParentBottom="true"
    android:orientation="horizontal"
    android:weightSum="2">


    <info.hoang8f.widget.FButton
        android:id="@+id/btnSignUp"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:layout_weight="1"
        android:text="@string/SignUp"
        android:textColor="@android:color/white"
        app:buttonColor="@color/darkGreen"
        app:cornerRadius="4dp"
        app:shadowColor="@android:color/black"
        app:shadowEnabled="true"
        app:shadowHeight="2dp" />

    <info.hoang8f.widget.FButton
        android:id="@+id/btnSignIn"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:layout_weight="1"
        android:text="@string/SignIn"
        android:textColor="@android:color/white"
        app:buttonColor="@color/lightGreen"
        app:cornerRadius="4dp"
        app:shadowColor="@android:color/black"
        app:shadowEnabled="true"
        app:shadowHeight="2dp" />

</LinearLayout>

Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71
Wade
  • 45
  • 12
  • Any help and one – Wade Jun 26 '19 at 20:08
  • Can you also add your main activity code? All I can deduce from the stack trace is that the possible cause is something related to info.hoang8f.widget.FButton(because of this - Error inflating class info.hoang8f.widget.FButton) and perhaps something related to the colour(because of this - Can't convert value at index 1 to color) I personally haven't used nfo.hoang8f.widget.FButton and hence cannot comment about that. Try checking along the above lines and hopefully, you will find the problem – Derryl Thomas Jun 27 '19 at 05:01
  • @DerrylThomas here is the link for the Main Activity Code.java "https://drive.google.com/open?id=1irjIW6Q1s71K00Kz_b2t8Tn38J6t8jLD" – Wade Jun 27 '19 at 08:58
  • Take a look at the answer I posted. Hopefully, it solves your issue. :) – Derryl Thomas Jun 27 '19 at 10:20
  • @DerrylThomas you have any idea which dependencies to use instead of that, since 'info.hoang8f:android-segmented:1.0.6' doesn't have some of the option or layout features. So, that I also won't mix up with com.android. and androidx version – Wade Jun 27 '19 at 11:35

2 Answers2

0

As i know, InstantRun is experimental feature.

Please try to disable it.

See the description on when it not works in docs: https://developer.android.com/studio/run/index.html#instant-run

Update:

BTW, original description of question had this text: "I/InstantRun: starting instant run server: is the main process Application terminated."

That is why my proposition and assumption came.

I do not ask to disable InstantRun completely. Just check it. If it helps, then code need to be changed to confirm InstantRun requirements mentioned in docs (or fill the bug to InstantRun there).

Alexandr
  • 1,704
  • 1
  • 14
  • 20
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/23373620) – Mihai Chelaru Jun 26 '19 at 12:47
  • Actually I think it is answer with a solution "disable InstantRun". Instant run is mentioned in question details. Also this instantRun not used in APK. So many points of question tells this will help. It is not clarification, not proposition, not attitude. It is solution proposition. Hope you reproduced issue and proved disabling of InstantRun not helps, before downvoting my answer ;) – Alexandr Jun 26 '19 at 13:07
  • 1
    Just for the record, I wasn't the one who downvoted. I saw this in the review queue and it looked to me like more of a comment of the "try doing this first and report back" type. You could at the very least include a link to the relevant documentation on Instant Run that you mention in your answer, or better yet quote it in your answer with a link to the original source. – Mihai Chelaru Jun 26 '19 at 13:11
  • 1
    I get your point but I have disabled the Instant run option, I saw many faced the same issue when they use that feature. However, it didn't help me. I tried that and also migrate all my dependencies to Androidx too. still, I am not being able to test my app, without testing its become difficult to know what needed to be added in the app. The funny part is now I don't get any error while building the Gradle and building the apk. The only thing is that its get terminated immediately as soon as it run. – Wade Jun 26 '19 at 18:54
  • The last thing I can do is that I can share my project so, that you can check what went wrong @MihaiChelaru – Wade Jun 26 '19 at 19:09
0

This seems to be a problem related to info.hoang8f.widget.FButton. Try changing the android gradle plugin version to 2.3.3. Take a look at this question - Error inflating class info.hoang8f.widget.FButton

Derryl Thomas
  • 1,324
  • 12
  • 22
  • Now, which dependencies to use instead of that? – Wade Jun 27 '19 at 11:31
  • I am sorry, I haven't used it and not sure what it does. Preferably use default android classes if you can achieve similar functionality. Otherwise, try searching for something similar. I am not in a position to suggest alternatives. – Derryl Thomas Jun 28 '19 at 05:01
  • Thank you either way, really appreciate it. – Wade Jun 28 '19 at 07:40