Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play store/fdroid flavors added #1878

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

neel1998
Copy link
Member

@neel1998 neel1998 commented Jul 17, 2019

Fixes #1739

Changes: play store/fdroid flavors added

Screenshot/s for the changes:

Google Map Demo

20190718_001944

Checklist: [Please tick following check boxes with [x] if the respective task is completed]

  • I have used resources from strings.xml, dimens.xml and colors.xml without hard-coding them
  • No modifications done at the end of resource files strings.xml, dimens.xml or colors.xml
  • I have reformatted code in every file included in this PR [CTRL+ALT+L]
  • My code does not contain any extra lines or extra spaces
  • I have requested reviews from other members

APK for testing:
app-fdroid-debug2.zip
app-playstore-debug2.zip

app/build.gradle Outdated
@@ -17,11 +17,13 @@ android {
debug {
versionNameSuffix "Version: "
resValue "string", "version", "${versionNameSuffix}${defaultConfig.versionName}"
resValue "string", "google_maps_key", "AIzaSyBFvrqI8_J108WntI7surDGqCUcd1RbHPQ"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer this from a resource file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find proper way to access string resource in gradle file . So as suggested in this article https://medium.com/code-better/hiding-api-keys-from-your-android-repository-b23f5598b906 i am adding key to gradle.properties and then accessing it in build.gradle.

app/build.gradle Outdated
@@ -70,12 +82,13 @@ dependencies {
implementation 'com.github.Triggertrap:SeekArc:v1.1'

implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
playstoreImplementation 'com.google.android.gms:play-services-maps:16.0.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set versions like the rest of libraries here

@@ -1,4 +1,4 @@
package io.pslab.activity;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this activity moved out from activity package and taken out? Revert.

app/src/main/AndroidManifest.xml Show resolved Hide resolved
@CloudyPadmal
Copy link
Collaborator

I checked both the APKs. I couldn't open the map view in playstore flavor and it crashes with this log

2019-07-18 11:30:34.472 1345-1378/io.pslab E/AndroidRuntime: FATAL EXCEPTION: Thread-4
    Process: io.pslab, PID: 1345
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
        at gw.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):3)
        at gt.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):3)
        at gv.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):14)
        at com.google.maps.api.android.lib6.drd.ak.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):6)
        at fx.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):22)
        at fx.run(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):8)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000000d/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000000d/MapsDynamite.apk!/lib/x86, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at ab.loadClass(:com.google.android.gms.dynamite_dynamiteloader@[email protected] (100700-253824076):4)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at gw.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):3) 
        at gt.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):3) 
        at gv.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):14) 
        at com.google.maps.api.android.lib6.drd.ak.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):6) 
        at fx.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):22) 
        at fx.run(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100700-253824076):8)

In fdroid flavor, open street map is not shown, just the brownish grid with no map. @ho-dor @AakashMallik @cweitat can you try the apks and see?

@neel1998
Copy link
Member Author

@CloudyPadmal i uninstalled the app and reinstalled using the playstore apk, and it worked fine with me. About the OSM , i haven't modified the code of the OSM, it was not showing map before as well I think, so I thought something was wrong with OSM itself. I will check once though.

@cweitat
Copy link
Contributor

cweitat commented Jul 18, 2019

Doesn't crash on my phone. The only problem is the OSM does not load.
@neel1998 OSM used to work

@neel1998
Copy link
Member Author

@CloudyPadmal i think I found the problem with the crash. I think you are using Android P. It is a famous issue with Android P and google has provided a solution. I will send you apk in few minutes. Hopefully it will work

@neel1998
Copy link
Member Author

Doesn't crash on my phone. The only problem is the OSM does not load.
@neel1998 OSM used to work

I will look into OSM. Thanks

@neel1998
Copy link
Member Author

@CloudyPadmal try this apk.
app-playstore-debug2.zip

@neel1998
Copy link
Member Author

@cweitat @CloudyPadmal check this Fdroid apk. It's working now. Apparently OSM library has made some changes in their provider and we need to set one config constant manually to get it working like before. Let me know if it works fine. Then i will push this change with rest of the requested changes. Thanks
app-fdroid-debug2.zip

@neel1998
Copy link
Member Author

@cweitat @CloudyPadmal i have made all the possible of the requested changes, i have also updated the apk in the PR message. Please check. Thanks

@CloudyPadmal CloudyPadmal merged commit d20bdfa into fossasia:development Jul 19, 2019
neel1998 added a commit to neel1998/pslab-android that referenced this pull request Jul 30, 2019
@neel1998 neel1998 deleted the OSM_google_map branch August 27, 2019 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to use OSM or Google Map
3 participants