AndraxDev / speak-gpt

Your personal voice assistant based on OpenAI ChatGPT.
https://play.google.com/store/apps/details?id=org.teslasoft.assistant
Apache License 2.0
290 stars 59 forks source link

Project Build Error #5

Closed smurat closed 1 year ago

smurat commented 1 year ago

Hi, Awesome project, I loved the assistant implementation and features But i cant build the project on my machine. First it gives this error

"The project is using an incompatible version (AGP 8.1.0-alpha11) of the Android Gradle plugin. Latest supported version is AGP 7.4.2" error

I changed plugin versions and gradle dependency from 8.1.0-alpha11 to 7.4.2 then it's fixed.

Now it gives error on app first opening screen then crash

Here is the error log:

FATAL EXCEPTION: main Process: org.teslasoft.assistant, PID: 11497 java.lang.IllegalStateException: Fragment PromptsFragment{896496d} (7cc87c2d-6175-4d0a-ad53-7ebf89eff349) not attached to an activity. at androidx.fragment.app.Fragment.requireActivity(Unknown Source:17) at org.teslasoft.assistant.ui.fragments.PromptsFragment$d.onResponse(Unknown Source:90) at org.teslasoft.core.api.network.RequestNetworkController$clientCall$1.onResponse$lambda$1(Unknown Source:0) at org.teslasoft.core.api.network.RequestNetworkController$clientCall$1.b(Unknown Source:0) at org.teslasoft.core.api.network.b.run(Unknown Source:6) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7926) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

AndraxDev commented 1 year ago

Can you please send me your device info (Android version, ROM, model). You don't need to change AGP config. Use latest version of Android Studio.

AndraxDev commented 1 year ago

I also recommed you to use APK file in "Releases" section if you have build errors. This app is compiled on a latest canary build of Android Studio.

smurat commented 1 year ago

Release apk works fine without problem. I am updated Android Studio the Canary version and build issues fixed. But PromptsFragment still gives same error log with crashed app if i run debug build from source code. My device: Xiaomi Mi 9T Pro Rom: Evolution X [ROM][13.0_r41][raphael] Android version: 13

AndraxDev commented 1 year ago

Tkanks for bug report. I will test it. Now you can still use release APKs.

AndraxDev commented 1 year ago

I found following fixes for your issues:

  1. Try to disable optimization and minification (comment out the following lines in the build.gradle)
release {
    debuggable false
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    multiDexEnabled true
}

debug {
    debuggable false
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    multiDexEnabled true
}
  1. Prompt Store uses private servers that requires API authentication. I do not publish API key for security purposes. I you interested in our APIs you can request dedicated API key.