Closed JeremyBradshaw7 closed 9 months ago
Same, and also => Unresolved reference: PackageList
For me it was a missing import in the MainApplication.kt file:
import com.ccf.BuildConfig
though that's not in the default project so doesn't show up on upgrade-helper. It's something to do with Android Gradle Plugin (AGP) 8 I think.
EDIT: See my later comment
I stumbled upon this with same issue. I thought it was odd I didn't have that BuildConfig import, but my machine and others worked fine with debug & release builds. It was only our CI pipeline having an issue.
I haven't yet added the BuildConfig import myself, but something isn't adding up here.
I revisited this and it turns out that the import
in MainApplication.kt was a sticking plaster fix. The actual issue, as I found out later after hitting an application crash, was that I'd added the incorrect namespace
string to my android/app/build.gradle file as part of the 0.73 upgrade (I used the application id rather than the package id, normally the same for most projects but not for ours). Correct this and the import
in MainApplication.kt is no longer needed.
Thanks - we figured out our root issue as well. During the jump from 72 to 73 we changed to Kotlin .kt
files. This meant our fastlane pipeline with https://github.com/joshdholtz/fastlane-plugin-rename_android_package, was no longer properly renaming packages.
@thymikee @JeremyBradshaw7 @iBotPeaches not resolved for me i am also facing same issue
not resolved for me i am also facing same issue
There's a solid amount of context and details in this thread. Paired with your message of pinging 3 people with absolutely zero context I don't see how you expect this to go.
Same problem. Nothing solved it for me
EDIT:
using android studio and following the following steps just resolved this issue for me.
Android Studio -> Build -> Clean Project -> rebuild project
doing this generated a buildConfig file in my com.myapp.com.BuildConfig and I just imported it.
I had the same problem and I fixed it when i found that the first line in MainActivity.kt is importing the wrong appname it was package com.myapp while it needs to be package com.{you_actual_app_name}
i same problem,
fixed when changing namespace = "com.myapp"
in android/app/build.gradle
to my package name
"expo": "~51.0.20", "react-native": "0.74.3"
I had the same issue and none of these solutions worked for me.
The problem was because of this line in the MainActivity.kt
file --> import com.swmansion.reanimated.BuildConfig
.
Removing this line fixed the issue in MainApplication.kt
.
Had a typo in namespace in build.gradle as suggested by JeremyBradshaw7 Must match package name in MainApplication/MainActivity. Thanks
@iBotPeaches how are you renaming the packages now? Did you figure out an alternative to using https://github.com/joshdholtz/fastlane-plugin-rename_android_package?
@CaptainJeff - We forked it and I pinged the author of that plugin a few times and offered a PR to fix, but it looks abandoned.
https://github.com/sourcetoad/fastlane-plugin-rename_android_package
Generally just add this to Gemfile
and rerun bundle install
if you want to use the fork.
gem 'fastlane-plugin-rename_android_package', :git => 'https://github.com/sourcetoad/fastlane-plugin-rename_android_package', :branch => 'kotlin-support'
@iBotPeaches oh incredible. Thanks so much for 1) the fork 2) getting back to me so fast. Appreciate it!
I revisited this and it turns out that the
import
in MainApplication.kt was a sticking plaster fix. The actual issue, as I found out later after hitting an application crash, was that I'd added the incorrectnamespace
string to my android/app/build.gradle file as part of the 0.73 upgrade (I used the application id rather than the package id, normally the same for most projects but not for ours). Correct this and theimport
in MainApplication.kt is no longer needed.
Thanks so much!
I'm solved the issue by adding import com.rndiffapp.BuildConfig
to MainApplication.kt
.
I Solved this issue by adding
buildFeatures { buildConfig = true }
in the Android{} section that located at Android/app/build.gradle
Environment
Things I’ve done to figure out my issue
Upgrading version
0.73.5
Description
Android build has these errors in ./gradlew build command:
MainApplication.kt has the same references to BuildConfig as a brand new react native typescript project, which doesn't break in the same way, so this is very odd.
After some googling of the error I've tried adding this to my build.gradle, but it hasn't helped:
My MainApplication.kt file:
Been stuck on this a day - please help!