Exporting to Android (MV Android Client)

Discussion in 'RPG Maker MV Tutorials' started by xilefian, Sep 29, 2017.

  1. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    @xilefian it is possible use a cordova plugin inside your Client? (Like Vibration Plugin for example)
     
  2. _Z_

    _Z_ Villager Member

    Messages:
    9
    Likes Received:
    10
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    I had to build in webview as opposed to crosswalk and make sure your building a signed apk with version 1 and version 2 signatures, I had a similar issue the first build I attempted.
     
  3. xilefian

    xilefian Veteran Veteran

    Messages:
    107
    Likes Received:
    155
    First Language:
    English
    I actually started looking at getting Cordova directly used, however Cordova doesn't seem very friendly to such an idea. I'll reassess when I have more time.

    But if you want vibration you can just call navigator.vibrate([500]); in MV (try making this as a script call in an Event for a quick test). If that doesn't work then there's probably a security issue going on.

    Getting Node.js features (what Cordova brings to the table) is tricky. I had started re-implementing them myself a couple years back but it is an insane task, it would be smarter to find an Android port of Node specifically for WebView instances (maybe Cordova can provide the answer).
     
  4. TehGuy

    TehGuy Sometimes the 1s and 0s make sense Member

    Messages:
    27
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    So should I or should I not stop my work on converting my old extension-based code for (the working parts of the) GPlay API stuff over to an AAR? (askin so we don't have, like, 2-3 people trying to do the same thing except they don't know the others are doin' it)

    >Would've brought it up on the github issue if I hadn't been swamped with school for the past bit and kept forgettin' >->
     
  5. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    Thank you!
    At the first try it doesn't work, then i remember that i forgot permission in Manifest file.
    So just adding
    Code:
        <uses-permission android:name="android.permission.VIBRATE"/>
    It work perfectly!
    Thank you Xilefian.
     
  6. xilefian

    xilefian Veteran Veteran

    Messages:
    107
    Likes Received:
    155
    First Language:
    English
    Continue your work converting it to an AAR, I suggest you have it as its own GitHub repo so we can reference each other and work on Google Play features separately.

    In the meantime, perhaps discuss what a standard Android API for MV would look like. There are concerns such as Google Play Services not being available in some regions that we need to think about. China is the biggest region using MV Android Client and Google Play Services are not available in that region, so discussion is needed.
     
  7. TehGuy

    TehGuy Sometimes the 1s and 0s make sense Member

    Messages:
    27
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Done
    Intent is to handle achievements, events, and leaderboards as the extension version did.

    I'll see what I can do with regions that dont have Play Services; part of me wants to think that, currently, things will just fail to connect and any calls from MV will be consumed with no result (for better or worse) but another is kinda nagging me that this isn't the case
     
    Last edited: Feb 9, 2019
  8. xilefian

    xilefian Veteran Veteran

    Messages:
    107
    Likes Received:
    155
    First Language:
    English
    My thoughts are to separate functionality between Google Play Services required and not required. So something like Android file system access does not need Google Play Services, but Achievements, OBB expansions, etc would.

    Stuff that doesn't need Google Play can be merged in with main MV Android Client, stuff that does can stay as an AAR library.

    Once you have a tutorial for integrating your Google Play AAR we can probably look into tidying it up to be inline with the Altimit Community Contributors guidelines and link it as an official library for MV Android Client as an additional step in the tutorial.

    I'll probably look at what you've got and start working out plans on an internal Android library in the main project.

    EDIT: OBB support would work best as part of the main MV Android Client, it doesn't explicitly need Google Play either, so that one would probably go under the category of "Android API" rather than "Google API".
     
    Last edited: Feb 10, 2019
  9. AlefRichard

    AlefRichard Villager Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Sorry to bother, but... someone known how to solve this?
     

    Attached Files:

    • wat.png
      wat.png
      File size:
      37.1 KB
      Views:
      6
  10. TehGuy

    TehGuy Sometimes the 1s and 0s make sense Member

    Messages:
    27
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
  11. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    Can't build with signature with the latest update :(
    The key is correct with older versions work.

    EDIT:
    If someone have problem to sign an app try to change in
    Build gradle Project:
    Code:
       dependencies {
            classpath 'com.android.tools.build:gradle:3.3.1'
        }
    to
    Code:
       dependencies {
            classpath 'com.android.tools.build:gradle:3.3.0'
        }
    I don't know why, but it works for me.
     

    Attached Files:

    Last edited: Feb 11, 2019
  12. AlefRichard

    AlefRichard Villager Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I was having this problem of signature too so I uninstalled Android studio and installed the 3.2.1 and had the another problem I was talking about, I think I have to return to latest:rswt2:
     
  13. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    It's strange i cant understand what is.
    Actually looks randomly for me...
    Wich kind of error you got?
    Cant find alias?
    Or incorrect key?
     
  14. TehGuy

    TehGuy Sometimes the 1s and 0s make sense Member

    Messages:
    27
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Quite odd; created a new key and it signs just fine using com.android.tools.build:gradle:3.3.1
     
  15. Damage Control

    Damage Control Damage Control PH Member

    Messages:
    22
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Excuse me, @xilefian,
    I have a bad error on 'Build APK.
    Since i've tried to sync builds and customize app id, then i'm trying to build debug apk and i got this:
    "Android resource linking failed

    error: resource style/Theme.AppCompat.NoActionBar (aka com.dcph.mtc.and:style/Theme.AppCompat.NoActionBar) not found.

    C:\RPGMV to APK\mv-android-client-master2\app\build\intermediates\incremental\mergeWebviewDebugResources\merged.dir\values\values.xml:37: error: style attribute 'attr/colorPrimary (aka com.dcph.mtc.and:attr/colorPrimary)' not found.

    C:\RPGMV to APK\mv-android-client-master2\app\build\intermediates\incremental\mergeWebviewDebugResources\merged.dir\values\values.xml:38: error: style attribute 'attr/colorPrimaryDark (aka com.dcph.mtc.and:attr/colorPrimaryDark)' not found.

    C:\RPGMV to APK\mv-android-client-master2\app\build\intermediates\incremental\mergeWebviewDebugResources\merged.dir\values\values.xml:39: error: style attribute 'attr/colorAccent (aka com.dcph.mtc.and:attr/colorAccent)' not found.

    error: failed linking references."


    Android tools i got:
    Android studio ver: 3.3.1
    Jdk ver: 1.8.0.221

    And the latest MV Android Client that i downloaded earlier.

    Please solve this.
    -LeonardPlaysMC
     
  16. xilefian

    xilefian Veteran Veteran

    Messages:
    107
    Likes Received:
    155
    First Language:
    English
    This error happens when you corrupt a build.gradle file. Can you copy your gradle file to pastebin and link it here? It's likely when you changed application id you broke something else (maybe you used an invalid ID).
     
  17. Damage Control

    Damage Control Damage Control PH Member

    Messages:
    22
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    @xilefian
    This is the code from "C/...mv-android-client-master/app/build.gradle":
    Code:
    /*
     * Copyright (c) 2017-2019 Altimit Community Contributors
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *      http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or imp
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    apply plugin: 'com.android.application'
    
    android {
    
        /**
         * Advanced Configuration
         */
        def BACK_BUTTON_QUITS   = true // Use back button to quit the app?
        def SHOW_FPS            = false // Display the FPS monitor?
        def FORCE_CANVAS        = false // Disables fast WebGL rendering when available
        def FORCE_NO_AUDIO      = false // Disables WebAudio
        def ANDROID_SDK         = 28 // Android 9 "Pie" API 28
    
        compileSdkVersion ANDROID_SDK
    
        defaultConfig {
    
            /**
             * Project Identification
             */
            applicationId "com.dcph.mtc.and" // Change this to your applicationId.
            versionCode 1 // Set this to a higher number for game updates.
            versionName "1.0.12" // This is the version that the player sees.
    
            targetSdkVersion ANDROID_SDK
        }
    
        buildTypes {
            buildTypes.each { buildType ->
                buildType.buildConfigField "boolean",  "BACK_BUTTON_QUITS", String.valueOf(BACK_BUTTON_QUITS)
                buildType.buildConfigField "boolean",  "SHOW_FPS",          String.valueOf(SHOW_FPS)
                buildType.buildConfigField "boolean",  "FORCE_CANVAS",      String.valueOf(FORCE_CANVAS)
                buildType.buildConfigField "boolean",  "FORCE_NO_AUDIO",    String.valueOf(FORCE_NO_AUDIO)
            }
        }
    
        flavorDimensions "mv_android_client"
    
        productFlavors {
            webview {
                dimension "mv_android_client"
                minSdkVersion 21
    
                buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true"
            }
    
            // WARNING: As of February 2017 Crosswalk is no longer maintained https://crosswalk-project.org/blog/crosswalk-final-release.html
            zz_crosswalk {
                dimension "mv_android_client"
                minSdkVersion 21
    
                buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true"
            }
        }
    }
    Any questions?
    -LeonardPlaysMC
     
  18. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    @Damage Control check even
    Value.xml in res>values>
    error: style attribute 'attr/colorPrimaryDark looks like an error from there.
     
  19. Damage Control

    Damage Control Damage Control PH Member

    Messages:
    22
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    @Lakaroth
    The thing in app/src/main/res/values/values.xml:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!--
       Copyright (c) 2017-2018 Altimit Community Contributors
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    -->
    <resources>
    
        <!-- Theme Colors -->
        <color name="color_primary">#424242</color>
        <color name="color_primary_dark">#212121</color>
        <color name="color_accent">#009688</color>
    
        <!-- Icon Colors -->
        <color name="icon_background">#FFF</color>
    
        <!-- Project Name -->
        <string name="app_name">The Mystery in the Campus</string>
    
        <!-- Web Linking -->
        <string name="app_scheme">https</string>
        <string name="app_host">altimit.systems</string>
    
        <!-- Quit Message -->
        <string-array name="quit_message">
            <!-- Remove all items (empty string-array) to disable quit warning -->
            <item>Are you sure to quit?</item>
            <item>Your investigation will be undone!</item>
        </string-array>
    
    </resources>
    Is anyone solve this?
    -LeonardPlaysMC
     
    Last edited: Feb 11, 2019
  20. Lakaroth

    Lakaroth Veteran Veteran

    Messages:
    253
    Likes Received:
    125
    First Language:
    English
    @Damage Control values.xml looks ok...
    The only think you can do is to download the latest MV Client here and re import your project.
    If don't work, try to update Android Studio, maybe u use an older version.
     

Share This Page