Gradle - Build Error - netflix-eureka

I am new to Netflix eureka and Gradle, I am trying to build eureka client and server which is a gradle project; I checked out the code from "github.com/Netflix/eureka" and tried to build using "./gradlew clean build", but it is failing, below is the error message -
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'eureka'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.netflix.nebula:nebula-bintray-plugin:2.2.0.
Required by:
:eureka:unspecified > com.netflix.nebula:gradle-netflixoss-project-plugin:2.2.7
Could not HEAD 'http://plugins.gradle.org/m2/com/netflix/nebula/nebula-bintray-plugin/2.2.0/nebula-bintray-plugin-2.2.0.pom'.
peer not authenticated
..........
Things I tried
1> I added Proxy details in gradlew
DEFAULT_JVM_OPTS="-Dhttps.proxyHost=some.com -Dhttps.proxyPort=8080 -Dhttps.proxyUser=xyz -Dhttps.proxyPassword=123 -Dhttp.proxyHost=some.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=xyz -Dhttp.proxyPassword=123"
2> Downloaded certificate from plugins.gradle.org and added to java keystore; I added the certificate in the following way
2a. Launched firefox and went to plugins.gradle.org
2b. Viewed PEM file and saved it as pluginsgradleorg.cer (selecting All Files)
2c. Added it to Java Keystore # /usr/lib/jvm/java-1.7.0-openjdk-i386/jre/lib/security using
"keytool -import -alias gradleplungin -file pluginsgradleorg.cer -keystore cacerts -storepass changeit"
2d. After "Trust this certificate? [no]: yes" it showed "Certificate was added to keystore".
After these two fix also the error remains.
I am using Ubuntu 14.04.1 LTS, java version "1.7.0_65"
Any help in this regard is welcome and thanks in advance.
Let me know if more information is needed.

Related

gradlew signingreport missing keystore while getting sha 1 for release mode flutter apk

I was testing release mode of my app and the firebase auth is not working, so i google it and find out that i have to register SHA1 for release mode, and to get it we need keysotre file which i generated using command:
keytool -genkey -v -keystore release.keystore -alias AndroidReleaseKey -keyalg RSA -keysize 2048 -validity 10000
i was taking help of this documentaion: Click here
and THIS STACKOVERFLOW QUESTION
but now when i run ./gradlew signingreport i am getting this
i want the SHA1 key for release mode can anyone help me through it and also my android studio is not working fine so give me answers that doesn't require it.
Check Your Path c\file , And upgrade Project --flutter Upgrade or Update , After Retry.
I got it. The only mistake is that I put \ in store file path and when I use / instead it worked as I wanted.

Flutter Project: Getting Kotlin Related Errors When Generating Signed APK in Android Studio

I am able to build an unsigned APK using flutter build apk --split-per-abi --no-tree-shake-icons. However, when I attempt to generate a signed APK, I get several Kotlin related errors. To be clear, I can build the project without signing just fine. However, when I attempt to generate a signing key (via Android Studio) the process fails with the errors shown below. I believe the signing process uses 'tools.jar' which is available in JDK 8. I have added JDK 8 (liberica-1.8) to the project structure. I've seen some postings indicating openjdk#8 is not compatible with M1 Macs. The JDK 8 included with Android Studio, however, indicates that it supports aarch64 so I assume this isn't a problem. Nevertheless, I cannot determine the source of these errors.
MainActivity.kt:
I'm using the APK key generation process in Android Studio to sign my APK (Build > Generate Signed Bundle / APK):
I am not attempting to run ProGuard at this time:
I am running on Apple silicon. I've tried flutter clean and invalidating caches.
After further investigation and testing, I believe the bundle and APK signing process that's built into Android Studio (Bumblebee 2021.1.1) will not work on a M1 Mac. I tested this process using a variety of JDKs. Each time, I get the same errors I shared earlier (JDK 8 must be used to avoid a missing tools.jar problem). I strongly suspect (but have not yet tested) that this same signing process works fine on Intel Macs.
As a workaround for M1 Macs, I am posting a comprehensive solution found here that is derived from posts by RichardC and Kit.
(A) To generate the keystore:
keytool -genkey -v -keystore ~/Desktop/upload-keystore.keystore -alias upload -keyalg RSA -keysize 2048 -validity 10000
(B) To sign an APK:
jarsigner -verbose -keystore ~/Desktop/upload-keystore.keystore ~/Desktop/app-armeabi-v7a-release.apk upload
(C) If the above command fails, try this one (SDK must be at least 1.7):
jarsigner -verbose -digestalg SHA1 -sigalg MD5withRSA -keystore ~/Desktop/upload-keystore.keystore ~/Desktop/app-armeabi-v7a-release.apk upload
(D) To zip align an APK:
~/Library/Android/sdk/build-tools/32.0.0/zipalign -f -v 4 ~/Desktop/app-armeabi-v7a-release.apk ~/Desktop/app-armeabi-v7a-release-za.apk
NOTE: make sure to check/replace 32.0.0 as needed.
(E) If the APK file is already signed, remove the original sign with following code:
Zip -d ~/Desktop/app-armeabi-v7a-release.apk META-INF/*
I was able to sign the APKs I built with Flutter flutter build apk --split-per-abi --no-tree-shake-icons using these CLI commands with no issues on my M1 Mac. Hopefully a future release of Android Studio corrects this issue.

Missing keystore in Flutter

I want to get the SHA-1 code, but I encountered an error.
C:\Users\erdem\AndroidStudioProjects\flutter_app\android>gradlew
signinReport
Missing Keystore
how can I solve this problem?
I was trying to get the SHA1 but I couldn't get because of the missing keystore error, I tried that and it worked for me I don't know if it really works.
If you have your own jks file and did lead it with key.properties but still gives the error Missing Keystore that worked for me :
Type keytool -alias "AndroidDebugKey" -genkeypair in the terminal of your android studio give it a password of android.
The rest of the fields or questions asked after that don't matter so just press Enter.
Go to your home directory (C:\Users) and look for a file named as .keystore.
Rename .keystore to debug.keystore.
Now copy and paste it to (C:\Users.android).
Re-run the signReport task to generate a new key for APP.
source: https://stackoverflow.com/a/63064024/7767761
Had the same issue. Cleanest fix I found is to generate a debug key:
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"
gradlew signinReport will work after that.
Source
You can follow these steps:
Create a file named /android/key.properties that contains a reference to your keystore:
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=key
storeFile=<location of the key store file, such as /Users/<user name>/key.jks>
I had the same problem.
This error comes when dubug.keystore file is missing in users/"Name"/.android/ directory and can be resolved by simply run your app on any mobile device it will create the debug.keystore file in the directory now the error should be gone on running signingreport.
cheers..!

The gradlew signingReport for the SHA-1 key is not yielding any results - VS Code

I've been trying to use ./gradlew signingReport to get the SHA-1 of my signing certificate but with no luck. I get this error:
> Task :app:signingReport
Variant: debug
Config: debug
Store: /home/user/.android/debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore
I have created the project in VS Code on Ubuntu. Can someone help please?
Finally got it.
Once gradlew is installed on the system. Install the debug.keystore in the system's android directory and then move to the android project in the project and run this script. It works.

Resigning my app with the same keystore failed

Salam all,
I've created an app for android 2.2 using Eclipse and I have signed using a keystore that I have created, then I have upload it to the Market.
I have done some changes on the app, I have changed the app version from 1.0 tp 1.1, then I have tried to sign the new generated .apk file but I've got the following error:
jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 525 but got 527 bytes).
This error occurs when you try to sing a signed .apk file, I have generated an unsigned .apk from Eclipse and my app signed successfuly.
Now the Market refuses my new signed app, I guess that the first version was signed by Eclpise and my keystore, now I cannot have a new version signed by both. is this true analysis?
What am I doing wrong?
To get an unsigned apk in Eclipse, right click on application name in the Package Explorer window and choose Android Tools, then choose "Export Unsigned Application Package...". Save the package to a new location.
Once you have an unsigned apk. Run the jarsigner command you were using on the unsigned apk file.
$ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name
$ jarsigner -verify my_signed.apk
$ jarsigner -verify -verbose -certs my_application.apk
Note: If you see "CN=Android Debug", this means the .apk was signed with the debug key generated by the Android SDK. If you intend to release your application, you must sign it with your private key instead of the debug key.
$ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
$ zipalign -c -v <alignment> existing.apk
Source:
http://forum.xda-developers.com/showthread.php?t=492822
http://developer.android.com/guide/developing/tools/zipalign.html
This fixed my issue