"java.exe" exited with code 1 Xamarin-forms
I'm developing an app using xamarin-forms.
I faced this error lately after using the Google Play Services Plugin version = 116.0.1.
I know there is a thousand answers to my question but i've tried several thing before posting my own.
1- enabling multi-dex + dex compiler = d8 + code shrinker = r8
2- increasing java max heap size = 1G
3- downgrading GooglePlaySerivec to version 71.1610.4
4- updating the java JDK
6- adding this package reference into the Android.csproj
7- i saw an answer to this error Xamarin.Forms "java.exe" exited with code 1 in debug mode , i don't know if it can be related to my problem but i tried it any way, adding this line in Android.csproj
<PackageReference Include="Xamarin.Google.Guava" ExcludeAssets="all">
8- removing the obj and bin folder and clean and rebuild
9- i made sure the encoding of Android.csproj file is utf-8
but all of this didn't help me to get rid of the error.
NOTE sometimes the project builds successfully, but I get another error,
i think it's due to the shrinker removing the FCM Methods
here is the log
[FirebaseApp] com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization. [FirebaseApp] com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization. [FirebaseApp] com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization. [FirebaseInitProvider] FirebaseApp initialization successful [.realestatedem] Accessing hidden method Ljava/util/HashMap$HashIterator;->hasNext()Z (light greylist, JNI) **Java.Lang.NoSuchMethodError:** 'no static method "Lcom/google/firebase/messaging/FirebaseMessaging;.getInstance()Lcom/google/firebase/messaging/FirebaseMessaging;"' [.realestatedem] ProcessProfilingInfo new_methods=247 is saved saved_to_disk=1 resolve_classes_delay=8000
I've been working on this error for a week now and I've tried many things desperately, and I don't even have a clue so if anyone can help me with this it'll be really appreciated.
thanks in advance.
Your pictures were failed to display, could you please upload again?
Generally, the issue was caused by the Proguard or Incompatibility.
Your Proguard seems setting right. Did you upgrade the Proguard? If so, you need to and those files into the new Proguard folder.
proguard-android-optimize.txt, proguard-android.txt, and proguard-project.txt.
Referring to this issue Incompatibility of Xamarin.Firebase.Firestore 122.1.2 with Xamarin.Forms 22.214.171.1242, you can try to use Guava version 126.96.36.199 along with Xamarin Forms 188.8.131.521.
Sign in to comment