Android 14 fix

This commit is contained in:
Yuriy Liskov
2024-08-12 21:51:58 +03:00
parent 9cce45faf9
commit 3969fe1404
6 changed files with 39 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ buildscript {
// google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:8.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -23,10 +23,10 @@ buildscript {
ext {
// Google Play SDK version requirements:
// https://support.google.com/googleplay/android-developer/answer/11926878
compileSdkVersion = 33
buildToolsVersion = "29.0.3"
compileSdkVersion = 35
buildToolsVersion = "35.0.0"
minSdkVersion = 14
targetSdkVersion = 33
targetSdkVersion = 35
espressoCoreVersion = 'com.android.support.test.espresso:espresso-core:2.2.2'
junitVersion = 'junit:junit:4.12'
robolectricVersion = 'org.robolectric:robolectric:3.5.1'
@@ -62,3 +62,17 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
// Fix 'Namespace not specified'
// https://stackoverflow.com/questions/76300671/android-getting-error-namespace-not-specified
// subprojects {
// afterEvaluate { project ->
// if (project.hasProperty('android')) {
// project.android {
// if (namespace == null) {
// namespace project.group
// }
// }
// }
// }
// }

View File

@@ -1,6 +1,6 @@
#Thu Jan 16 19:59:54 EET 2020
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

View File

@@ -1,6 +1,14 @@
apply plugin: 'com.android.application'
android {
// Latest gradle fix: https://stackoverflow.com/questions/76300671/android-getting-error-namespace-not-specified
namespace 'com.liskovsoft.leankeykeyboard'
// Latest gradle fix: https://stackoverflow.com/questions/22604627/gradle-buildconfigfield-buildconfig-cannot-resolve-symbol
buildFeatures {
buildConfig = true
}
// FIX: Default interface methods are only supported starting with Android N (--min-api 24)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -14,8 +22,8 @@ android {
applicationId "org.liskovsoft.leankeykeyboard.pro"
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode 192
versionName "6.1.22"
versionCode 194
versionName "6.1.24"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -33,7 +41,8 @@ android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
def project = "LeanKeyKeyboardPro"
def buildType = variant.variantData.variantConfiguration.buildType.name.take(1)
// Latest gradle fix: https://stackoverflow.com/questions/62075122/no-such-property-variantconfiguration-for-class
def buildType = variant.buildType.name.take(1)
def version = variant.versionName
def flavor = variant.productFlavors[-1].name

View File

@@ -29,7 +29,6 @@
<application
android:banner="@mipmap/ic_banner_main"
android:icon="@mipmap/ic_launcher_main"
android:roundIcon="@mipmap/ic_launcher_main_round"
android:label="@string/ime_name"
android:theme="@style/Theme.Leanback">

View File

@@ -5,6 +5,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.inputmethodservice.InputMethodService;
import android.os.Build;
import android.os.Build.VERSION;
import android.view.KeyEvent;
import android.view.inputmethod.InputConnection;
import com.liskovsoft.leankeykeyboard.BuildConfig;
@@ -78,6 +80,7 @@ public class KeyMapperImeService extends InputMethodService {
}
};
@SuppressWarnings("UnspecifiedRegisterReceiverFlag")
@Override
public void onCreate() {
super.onCreate();
@@ -88,7 +91,11 @@ public class KeyMapperImeService extends InputMethodService {
intentFilter.addAction(KEY_MAPPER_INPUT_METHOD_ACTION_INPUT_UP);
intentFilter.addAction(KEY_MAPPER_INPUT_METHOD_ACTION_TEXT);
registerReceiver(mBroadcastReceiver, intentFilter);
if (VERSION.SDK_INT < 33) {
registerReceiver(mBroadcastReceiver, intentFilter);
} else {
registerReceiver(mBroadcastReceiver, intentFilter, RECEIVER_EXPORTED);
}
}
@Override

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB