mik3y / usb-serial-for-android

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.
MIT License
4.81k stars 1.58k forks source link

Cannot resolve BuildConfig symbol #508

Closed amarz2195 closed 1 year ago

amarz2195 commented 1 year ago

Hello guys. I am using the github project to build a serial connection. I use the gtihub as a module imported into my project. Have been following the issue that is resolved by other users. It's working at first. But when I import it inside the project, the same problem occurs which is 'can't find symbol class BuildConfig'. do help me. Screenshot 2023-07-04 110540 This is my error Screenshot 2023-07-04 110609 This is my buildconfig that is generated How can I do this?

amarz2195 commented 1 year ago

why I cannot import import com.hoho.android.usbserial.BuildConfig;?

amarz2195 commented 1 year ago

I have work out the code until I only got this error Screenshot 2023-07-04 123413 help me on how to get the buildconfig. this is after i added the dependencies in the build.gradle (usbSerialExample) the java for buildconfig is not generated automatically after adding the dependencies. why?

kai-morich commented 1 year ago

if your project is using gradle 8.0 you have to add the following line to gradle.properties file

android.defaults.buildfeatures.buildconfig=true
amarz2195 commented 1 year ago

thank you for the information what does this mean? Screenshot 2023-07-04 135728

kai-morich commented 1 year ago

I typically try build->Clean, Build->Rebuild, File->Sync-Project or File->Invalidate-Caches. Sooner or later the issue is resolved.

amarz2195 commented 1 year ago

i have tried all the methods above, all of the method can't help in resolving the error that i get Screenshot 2023-07-04 145648 it says that because I have two buildconfig files. but the two is in buildconfig java is in different files. one in usbserialexample and also in usbforandroid. how can i do this?

kai-morich commented 1 year ago

I recommend you restart with a plain fork and then change step by step

amarz2195 commented 1 year ago

thank you sir