CloudPOS SDK
  • CloudPOS SDK
    • EMV Develop Spec
    • Scanning Service Usage
    • API Specification
    • CloudPOS SDK AAR
    • Java API Samples
    • Permissions
    • Error code
    • MDB Communication Protocal
  • POS_Specs
  • FAQ
    • SDK Error Collection
      • Printer
      • PINPAD
      • Contactless Card
      • IC Card
      • MSR Card
    • Hardware/Repair
      • Recover a Tampered Terminal
      • Learning Tampered Events
      • Remotely Reactivate from Tamper
      • TF (Micro SD) Card Suggestion
      • Understand Tamper Reason
    • Printer
      • Verify Terminal Printer Status
      • Print Unsupported Character Sets
      • Use Terminal Bluetooth Printer
      • Print Images
      • Print QR Codes
      • Evaluate HTML Print Performance
      • Evaluate Print Performance
      • Print with TM T88IV
      • Replace HTML Print Font
      • Java API Printer Operations
      • Understanding Image Print Gaps
      • Print with JavaScript
      • Verify Printer Paper Status
    • USB/Serial Port
      • Install Terminal USB Drivers
      • Install UU Cable Driver
      • Reinstall Production Serial Drivers
      • Linux Serial Driver Installation
      • Serial Port Development
      • Add Linux Udev Rules
      • ReOpen Serial after Wake-up
      • Close Serial after Disconnect
      • Connect Accessory Mode
      • Detect UU Cable Connnected
      • Control Fan via Serial Port
      • List Connected USB Devices
      • Accessory Agent Service D22/Q3
    • Firmware
      • Update Firmware
      • Understand Firmware Naming
      • Compare Engineer/User Modes
      • Configure POS Home Settings
      • Configure POS System Settings
      • Prevent Accidental App Uninstallation
      • Troubleshoot "Agent Stopped" Error
      • Resolve Forgotten Lock Password
      • Utilize Q1 Buttons
      • Adapt Q1 4G
      • Customize Boot Logo/Animation
      • Set Wallpaper
      • Activate Startup Special Mode
      • Install Browsers
      • Understand Firmware External Access
      • Get Terminal Firmware Modes
      • Write Customer Serial Numbers
      • Enable Touch Screen Wake-Up
      • Set User System Properties
      • Enable and Disable MTP
      • Update POS WebView
      • Disable File Explorer for TF/Pendrives
      • Manage Screen On/Off
      • Disable notification badges
      • Scheduled Terminal Reboot Setup
    • Settings Menu
      • Perform Factory Data Reset
      • Understand Settings Menus
      • View Terminal Certificate List
      • Understand Merchant Self Test
      • Use Network Self-Test
      • Change System Language
      • Log in as Administrator
      • Change Administrator's Login Password
      • Update Terminal Time
      • Update Terminal Time Zone
      • Update Time Zone from IP
      • Enable Settings Menu Role Control
      • Update Role Passwords API
      • Disable Bluetooth/Wi Fi
      • Enable/Disable Auto Time Zone
      • Enable/Disable Automatic Time
      • Set Display Sleep
      • Grant Accessibility Permission Automatically
      • Disable Security Lock
      • Access Settings Sub Menu
      • Set Language API
    • Battery/Power
      • Understand Special Charging Indicator
      • Preserve Terminal Battery Life
      • Understand Q2 Low-voltage Shutdown
      • Understand Terminal Battery Performance
      • Understand Counter Mode
      • Turn Off Terminal API
    • SIM/Ethenet/WIFI
      • Disable POS Hotspot
      • Activate POS Hotspot
      • Retrieve Terminal IMEI Number
      • Retrieve Terminal MEID Number
      • Understand Modem Bands
      • Troubleshoot Terminal SIM Signal
      • Resolve SIM Network Issues
      • Troubleshoot Network Search Error
      • Check eSIM Status
      • Ethernet Connectivity Usage
      • Set Communication Mode
      • Troubleshoot USSD Issues
      • Set Preferred Network Type API
      • Add APN API
      • Set Static Ethernet API
      • Enable/Disable Mobile Data API
      • Set Network Operators API
      • Activate eSIM
      • Enable/Disable Ethernet
    • Certificate
      • Apply App Certificates
      • Renew App Certificate
      • App Installation Controls
      • Install CA Certificates
      • Clear Terminal Certificates
      • Understand Certificate Visibility
    • Card
      • Contactless Card Distance
      • NFC Buffer Size Understanding
      • Use Contactless CPU Card
      • Use Felica Card
      • Use Mifare Card
      • Understand PSAM Card Exceptions
      • Optimal Tap Positioning Guide
    • FingerPrint
      • Fingerprint Module Usage Guide
      • Fingerprint DPI Specifications
      • Fingerprint Data Formats
    • Other Development
      • New Android Studio Versions
      • Setup ANDROID HOME
      • App Signing Process
      • Install POS Applications
      • Create First Android App
      • Retrieve Terminal Logs
      • Resolve APK Signature Conflict
      • Obtain Unfiltered Full Log
      • Obtain Terminal Current Location
      • Use Terminal Camera
      • Get Test APKs
      • Learn ADB Commands
      • Get Advanced Demos
      • Import Java SDK in C
      • Obtain Signal Strength
      • Get D3 Demos
      • Learn Kiosk Mode
      • Block Status Bar API
      • Display Full-Screen API
      • Display Full Screen Android API
      • Disable Home Key
      • Capture Power Button API
      • Retrieve Terminal Info
      • Save Files Locally
      • Set Default Launcher
      • Get Firmware Version
      • Get Firmware&EMV Version
      • Implement TLSv1.3
      • Auto-Run Post-Install
      • Understand Secure Connections
      • Use AnyDesk
      • Export Database to SD
      • Migrate App to Q2Premium
      • Auto-Run App Post-Boot
      • Integrate Java SDK in Flutter
      • Call AIDL Interface
      • Connect wirelessly
      • Get POS SN
      • UPT development-related
      • Q3 PDA Terminal Barcode Scanner
    • Key Injection
      • Inject Test Keys Remotely
      • Understand DUKPT
      • Understand Master&Session Keys
      • Use TMK KeyLoader POS
      • Understand Remote Key Injection
      • Resolve Serial Timeout
      • Import TMK Error: 74496
    • PINPAD
      • PINPAD Configuration Summary
      • Customize PINPAD GUI
    • TMS/Wizarview
      • TMS Overview
      • TMS User Guide
      • Register Terminal to WizarView
      • Accept TMS File Downloads
      • Handle User Locked Status
      • Apply WizarView Account
      • Batch Import Terminals
      • Unbind App Configuration
      • Remove App via TMS
      • Understand Agent Error Codes
      • Understand TMS IP Ports
      • Understand Update Scenarios
      • Understand App Binding Types
      • Apply RMA Maintenance Account
      • Update Firmware Remotely
      • Push APK to Specific Device
      • Set Agent Working Mode
      • Manage APK Prompt Installation
      • Network Control in Agent
      • Push Apps Using Tags
      • Deploy AID/CAPK via TMS
    • EMV
      • What's Tag91
      • What's CAPK
      • Set Issuer Scripts
      • Resolve Detection Priority Conflict
  • Wizarview Open API
Powered by GitBook
On this page
  • How to Change AGP and Gradle Versions
  • Common Errors
  • Namespace Missing
  • Package Does Not Exist (aidl files not found)
  • Constant Expression Required
  • Cannot Find Symbol for AndroidX
  • Could not find method compile()
  • Manifest merger failed
  • Example build.gradle Files
  • build.gradle (Project: Name)
  • build.gradle (Module: app)
  • gradle.properties
  1. FAQ
  2. Other Development

New Android Studio Versions

PreviousOther DevelopmentNextSetup ANDROID HOME

Last updated 11 months ago

Newer Android Studio users may need to use updated versions for Android Gradle Plugin (AGP) and Gradle.

How to Change AGP and Gradle Versions

You can change the AGP version in the build.gradle file (buildscript —> dependencies —> classpath) by replacing with the current version number. Then, change the Gradle version under Project Structure.

The current minimum supported version is 8.6 for Android Studio Jellyfish | 2023.3.1 with AGP 8.4.1.

classpath "com.android.tools.build:gradle:8.4.1"

Common Errors

After syncing and building, you may run into other errors.

Namespace Missing

Namespace is required for . If the namespace is missing, it can be added under android in the build.gradle file for Module: app. Simply type namespace followed by the same string used by the applicationId under defaultConfig. This is also the same as the package name in the AndroidManifest.xml file under manifests. If the applicationId differs from the package name, use the package name.

namespace "com.wizarpos.xxx”

Some demos may not have an app folder, or the app folder is empty. This is due to the demo being converted from eclipse. In these cases, the two build.gradle files are combined into one file. Similarly, add the namespace under android in the build.gradle file, but it should be for Project: name instead of Module: app.

Package Does Not Exist (aidl files not found)

If the demo uses aidl, add the following lines of code within android {} (also in build.gradle) as some new versions have :

buildFeatures {
    aidl(true) 
}

Constant Expression Required

You can add android.nonFinalResIds=false to gradle.properties or change the switch-case function to if-else statements in the file where the error occurs (generally MainActivity.java).

gradle.properties

Simply copy the following line to the bottom of the file.

android.nonFinalResIds=false

Replacement with if-else

Mouse over the switch keyword and Android Studio should give you the option to replace. Alternatively, Ctrl + 1 or Alt + Enter will also bring up the option. The edited function should look like this:

public void onClick(View v) {
    if (v.getId() == R.id.example) {
        ...
    } else if (v.getId() == R.id.example2) {
        ...
    }
} 

Cannot Find Symbol for AndroidX

Copy the following line under dependencies in build.gradle.

implementation 'androidx.appcompat:appcompat:1.4.1'
//import androidx.annotation.Nullable; becomes
import android.support.annotation.Nullable;
android.useAndroidX=true
android.enableJetifier=true

Could not find method compile()

dependencies {
    //compile 'com.android...' replaced with
    implementation 'com.android...'
}

Manifest merger failed

If you receive the following error:

In the AndroidManifest.xml file, copy the following line into the activity element where the error occurs.

android:exported="true"

An example AndroidManifest.xml file is below.

<application
    ...>
    <activity android:name=".MainActivity" android:exported="true">
        <!-- modified line above -->
        ...
    </activity>
</application>

Example build.gradle Files

After applying the changes above, your files should look similar to these examples.

build.gradle (Project: Name)

buildscript {
    repositories {
        ...
    }
    dependencies {
        classpath "com.android.tools.build:gradle:8.4.1" //change plugin version
    }
}

allprojects {
    repositories {
        ...
    }
}

task clean(type: Delete) {
    ...
}

build.gradle (Module: app)

plugins {
    ...
}

android {
    namespace "com.myexample.myapplication" //add namespace
    ...
    defaultConfig {
        applicationId "com.myexample.myapplication"
        ...
    }
    
    buildFeatures { //add if necessary for aidl
        aidl(true)
    }
    ...
}

dependencies {
    implementation 'com.android...' //change compile
    runtimeOnly ... //change runtime
    testImplementation ... //change testCompile
    testRuntimeOnly ... //change testRuntime
    implementation 'androidx.appcompat:appcompat:1.4.1' //add if necessary for androidx
    ...
}

gradle.properties

...
android.nonFinalResIds=false //add if necessary for case R.id
android.useAndroidX=true
android.enableJetifier=true //not recommended

If the demo uses buttons with a switch-case function, you may get an error message "constant expression required" for a line such as case R.id.example. This is due to AGP 8.0.0 having default resources that are for optimized build speed.

You can also manually change the import statements following . For example:

Alternatively, you can copy these statements below into gradle.properties, but following the mapping is recommended as the flag can lead to slower build times.

Some configurations have been deprecated since and removed since . These include compile, runtime, testCompile, and testRuntime and should be replaced with implementation, runtimeOnly, testImplementation, and testRuntimeOnly respectively in the build.gradle file.

Manifest merger failed : android:exported needs to be explicitly specified for element <activity#example element>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See for details.

AGP 8.0.0
default value false
no longer declared final
this mapping
enableJetifier
Gradle 4.10
Gradle 7.0
https://developer.android.com/guide/topics/manifest/activity-element#exported