Giter VIP home page Giter VIP logo

Comments (23)

efraespada avatar efraespada commented on May 22, 2024 1

Thank you @sumitgohil. This night I'll try to finish a new version with some bugfixes, but I'll check it with a signed APK.

Thanks for your patient. 🙏🏼

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024 1

@sumitgohil @k4dima I just released a new version, 0.3. 🤞🏼
Note now for apply plugin you must use:

apply plugin: StringCare

Readme is updated.

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

@sumitgohil it seems that your release fingerprint hasn't been detected.
When you compile your project (or building your signed APK) the Gradle console should show something like this:

:sample:mergeMyCustomReleaseVariantResources
:sample:myCustomReleaseVariant:B8:DC:47:58:9B:5F:2C:22:45:C4:04:37:0E:56:54:DC:24:7B:2C:66
:sample:backupStringResources
	- values/strings.xml
:sample:encryptStringResources
	- values/strings.xml
		[hello world!] - [A8590C43DA85D67..]
:sample:mergeMyCustomReleaseVariantResources UP-TO-DATE
:sample:restoreStringResources
	- values/strings.xml
:sample:createMyCustomReleaseVariantCompatibleScreenManifests UP-TO-DATE

This would be the fingerprint for myCustomReleaseVariant buildVariant:
B8:DC:47:58:9B:5F:2C:22:45:C4:04:37:0E:56:54:DC:24:7B:2C:66

Could you confirm me your release variant is being detected?

PD: don't publish here your release fingerprint 😰

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

Yes, it is being detected. I get the same expected output as this.

:sample:mergeMyCustomReleaseVariantResources
:sample:myCustomReleaseVariant:B8:DC:47:58:9B:5F:2C:22:45:C4:04:37:0E:56:54:DC:24:7B:2C:66
:sample:backupStringResources
	- values/strings.xml
:sample:encryptStringResources
	- values/strings.xml
		[hello world!] - [A8590C43DA85D67..]
:sample:mergeMyCustomReleaseVariantResources UP-TO-DATE
:sample:restoreStringResources
	- values/strings.xml
:sample:createMyCustomReleaseVariantCompatibleScreenManifests UP-TO-DATE

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

@sumitgohil Is your project using few origins for resources. i.e:
app/src/main/res/ -> common resources folder
app/src/release/res/ -> release resources folder
app/src/develop/res/ -> debug/develop resources folder

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

Nope, there's just one in general.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada Thank you so much. Keep up the good work.

from androidlibrary.

k4dima avatar k4dima commented on May 22, 2024

@sumitgohil @efraespada Close and open Android Studio (all windows). It switches encryption key in plugin to currently selected variant.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@k4dima it's still not working for me.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@k4dima @efraespada

This is the console output when I generate signed APK.

:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources
:app:release:XX:XX:XX:XX:XX:FC:3A:B6:04:E2:0C:46:A6:42:A1:52:08:54:76:43
:app:backupStringResources
	- values\strings.xml
:app:encryptStringResources
	- values\strings.xml
		[hello world!] - [1777DA8EFA88F35..]
:app:mergeReleaseResources UP-TO-DATE
:app:restoreStringResources
	- values\strings.xml
:app:processReleaseManifest UP-TO-DATE
:app:processReleaseResources UP-TO-DATE
:app:generateReleaseSources UP-TO-DATE

from androidlibrary.

k4dima avatar k4dima commented on May 22, 2024

@sumitgohil select release in build variants. Then restart.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@k4dima It's still the same. No Changes.

In case you wish to have a look on these files.

Project Level Build File ---

apply plugin: com.stringcare.SCPlugin
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "com.stringcare:plugin:0.1" 
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Module Level Build File

apply plugin: 'com.android.application'
 
android {
    compileSdkVersion 27
    buildToolsVersion "27.0.2"
    defaultConfig {
        applicationId "com.ohitstrending.stringcare"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    jcenter()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile "com.stringcare:library:0.1"
    testCompile 'junit:junit:4.12'
}

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

Plugin could be getting a wrong fingerprint. @sumitgohil could you verify it? Run this on the root folder:

./gradlew signingReport

Checkout your buildVariant, release in your case:

----------
Variant: release
Config: release
Store: /....../.android/....keystore
Alias: AndroidReleaseKey
MD5: XX:XX:XX:XX:0D:05:4F:2C:8B:F0:CF:49:CD:36:D6:C0
SHA1: XX:XX:XX:XX:01:F7:AE:5A:44:B0:20:09:22:62:3A:A4:4D:EE:70 <-- should be the different than printed by plugin
Valid until: Thursday, January 31, 2047
----------

from androidlibrary.

k4dima avatar k4dima commented on May 22, 2024

@sumitgohil what is your java version? 9 is not working.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada

I Got this output. I dont know I'm always getting variant as debug even after changing the build variant. I'm sorry, I'm a little noob here.

Variant: debug
Config: debug
Store: C:\Users\Sumit\.android\debug.keystore
Alias: AndroidDebugKey
MD5: 43:DC:F5:0D:78:5A:FC:25:BF:87:DE:E4:D5:CC:C5:91
SHA1: A6:59:5A:52:C3:FC:3A:B6:04:E2:0C:46:A6:42:A1:52:08:54:76:43
Valid until: Sunday, July 14, 2047
----------
Variant: release
Config: none
----------

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada I tried with Latest Android studio i.e 3.0.1 with a fresh project and it works fine. I'm getting issue Studio 2.3.3.

Also, @k4dima It works fine with Java 9 with latest released library.

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

With your console output it seems release config is not defined yet, @sumitgohil. Only debug is defined.

Latest release works works on your PC (with any Android Studio version)?

Tonight I'll release another version for making plugin notify when config is not defined on current BuildVariant.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada
I tried on another PC with latest Android Studio i.e 3.0.1 . It worked fine.

Can you tell me how to define release config.

Also, once the release config is defined. Will it work fine as expected?

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

@sumitgohil yesterday I made few tests and it worked as expected (with all build variants configured) so it shouldn't give you any error. Once the releasevariant is configured, I hope it'll work 😅

About how to configure release variant, check out this link and read Configure Signing Settings:

android {
    ...
    defaultConfig {...}
    signingConfigs {
        release {
            storeFile file("myreleasekey.keystore")
            storePassword "password"
            keyAlias "MyReleaseKey"
            keyPassword "password"
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}

Try to configure it and confirm me it worked on your release variant. 😅
Then I'll close this issue.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada
Should I update my Android Studio to greater version and my Java to version 9?

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

@sumitgohil plugin (for compilation time) and library (for runtime) should always work on any version, but I recommend you to use always the latest stable version of Android Studio (3.0.1) and Gradle (so important, 4.4.1).

Check here all releases.

Gradle can be used globally by installing it on your computer, but the best option is Gradle Wrapper.
Gradle Wrapper is a "portable" version of Gradle that is defined on every Gradle project:

// grade/wrapper/gradle-wrapper.properties
 
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

As you can see, I use version 4.1.

For using it on terminal:

./gradlew --> gradle wrapper, available on the root folder of your project
gradle --> global gradle, always present

About the Java version, I didn't test Java 9, but it shouldn't affect.

from androidlibrary.

sumitgohil avatar sumitgohil commented on May 22, 2024

@efraespada , @k4dima Thank you so much you support.

As this Library is working fine on my another PC, there must be some issue with this one I suppose. Thus, you may close the issue.

Thank you again @efraespada

from androidlibrary.

efraespada avatar efraespada commented on May 22, 2024

@sumitgohil @k4dima new version -> 0.4

  • More logs with debug true
  • Some bugfixes
  • Detection of not configured variants

Thanks for your patient 🙌

Reopen this if the problem persist

from androidlibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.