diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f0c0afcb02d..7ee41f0c410 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,8 +21,8 @@ jobs:
- name: Android build
uses: ./.github/actions/build-android
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '18.x'
+ java-version: '17'
ios:
runs-on: macos-13
@@ -39,7 +39,7 @@ jobs:
- name: iOS build
uses: ./.github/actions/build-ios
with:
- node-version: '16.x'
+ node-version: '18.x'
js:
runs-on: ubuntu-latest
@@ -50,10 +50,10 @@ jobs:
with:
fetch-depth: 0
- - name: Use Node.js 16.x
+ - name: Use Node.js
uses: actions/setup-node@v3
with:
- node-version: '16.x'
+ node-version: '18.x'
cache: 'npm'
- name: Install dependencies
@@ -84,5 +84,5 @@ jobs:
uses: ./.github/actions/package
with:
node-version: '16.x'
- java-version: '11'
+ java-version: '17'
vtag: ${{ env.vtag }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9ab7e263666..120c547b08c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -77,8 +77,8 @@ jobs:
- name: Android build
uses: ./.github/actions/build-android
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '18.x'
+ java-version: '17'
ios:
runs-on: macos-13
@@ -97,7 +97,7 @@ jobs:
- name: iOS build
uses: ./.github/actions/build-ios
with:
- node-version: '16.x'
+ node-version: '18.x'
package:
runs-on: macos-12
@@ -116,8 +116,8 @@ jobs:
- name: Package
uses: ./.github/actions/package
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '18.x'
+ java-version: '17'
vtag: ${{ env.vtag }}
release:
diff --git a/android/.gitignore b/android/.gitignore
index 56cacb3ced2..b6bd8f6c33d 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -14,3 +14,4 @@ build/
/kroll-apt/bin/
/local.properties
/titanium/assets/Resources/ti.internal/build.properties
+/.idea/
diff --git a/android/.idea/codeStyles/Project.xml b/android/.idea/codeStyles/Project.xml
index 8d13c04b12c..36d210ea229 100644
--- a/android/.idea/codeStyles/Project.xml
+++ b/android/.idea/codeStyles/Project.xml
@@ -9,6 +9,9 @@
+
+
+
diff --git a/android/app/build.gradle b/android/app/build.gradle
index d2ac439bee8..2577c868951 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -9,7 +9,8 @@ apply plugin: 'com.android.application'
// Set up Android app project.
android {
- compileSdkVersion 33
+ compileSdkVersion 34
+ ndkVersion project.ext.tiNdkVersion
defaultConfig {
applicationId 'com.titanium.test'
minSdkVersion 21
@@ -19,9 +20,6 @@ android {
manifestPlaceholders = project.ext.tiManifestPlaceholders
manifestPlaceholders.put('localApplicationId', applicationId) // Legacy placeholder old AARs sometimes use.
}
- lintOptions {
- checkReleaseBuilds false
- }
sourceSets {
main {
assets.srcDirs = [
@@ -31,8 +29,12 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ namespace 'com.titanium.test'
+ lint {
+ checkReleaseBuilds false
}
}
diff --git a/android/build.gradle b/android/build.gradle
index 325c0af0c32..f03db25a724 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -6,17 +6,17 @@
*/
buildscript {
- ext.kotlin_version = '1.8.20'
+ ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.4'
- classpath 'com.google.gms:google-services:4.3.15'
+ classpath 'com.android.tools.build:gradle:8.3.1'
+ classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath 'org.codehaus.groovy:groovy-json:3.0.11'
+ classpath 'org.codehaus.groovy:groovy-json:3.0.17'
}
}
diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js
index ee4a6d17c9b..96411a1dd72 100644
--- a/android/cli/commands/_build.js
+++ b/android/cli/commands/_build.js
@@ -2042,7 +2042,6 @@ AndroidBuilder.prototype.generateLibProjectForModule = async function generateLi
// Load "AndroidManifest.xml", replace ${tiapp.properties['key']} variables, and save to above directories.
const manifest = await AndroidManifest.fromFilePath(sourceManifestFilePath);
- manifest.setPackageName(moduleInfo.manifest.moduleid);
manifest.replaceTiPlaceholdersUsing(this.tiapp, this.appid);
await manifest.writeToFilePath(path.join(debugDirPath, 'AndroidManifest.xml'));
await manifest.writeToFilePath(path.join(releaseDirPath, 'AndroidManifest.xml'));
@@ -2065,7 +2064,6 @@ AndroidBuilder.prototype.generateLibProjectForModule = async function generateLi
this.logger.error(`Unable to load Android content from: ${tiModuleXmlFilePath}`);
throw ex;
}
- mainManifest.setPackageName(moduleInfo.manifest.moduleid);
await mainManifest.writeToFilePath(path.join(projectSrcMainDirPath, 'AndroidManifest.xml'));
// Generate a "build.gradle" file for this project from the SDK's "lib.build.gradle" EJS template.
@@ -2157,6 +2155,7 @@ AndroidBuilder.prototype.generateRootProjectFiles = async function generateRootP
gradleProperties.push({ key: 'android.useAndroidX', value: 'true' });
gradleProperties.push({ key: 'android.enableJetifier', value: 'true' });
gradleProperties.push({ key: 'android.suppressUnsupportedCompileSdk', value: '33' });
+ gradleProperties.push({ key: 'android.nonTransitiveRClass', value: 'false' });
gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory}` });
await gradlew.writeGradlePropertiesFile(gradleProperties);
@@ -3681,9 +3680,6 @@ AndroidBuilder.prototype.generateAndroidManifest = async function generateAndroi
// Write secondary "AndroidManifest.xml" if not empty.
if (!secondaryManifest.isEmpty()) {
- // Make sure package name is set in so that ".ClassName" references in XML can be resolved.
- secondaryManifest.setPackageName(this.appid);
-
// Replace ${tiapp.properties['key']} placeholders in manifest.
secondaryManifest.replaceTiPlaceholdersUsing(this.tiapp, this.appid);
diff --git a/android/cli/commands/_buildModule.js b/android/cli/commands/_buildModule.js
index 1fdf5c78767..3405f072cc1 100644
--- a/android/cli/commands/_buildModule.js
+++ b/android/cli/commands/_buildModule.js
@@ -613,12 +613,6 @@ AndroidModuleBuilder.prototype.generateModuleProject = async function generateMo
this.logger.error('Unable to load Android content from "timodule.xml" file.');
throw err;
}
- let packageName = moduleId;
- if (packageName.indexOf('.') < 0) {
- packageName = `ti.${packageName}`;
- }
- mainManifest.setPackageName(packageName);
- await mainManifest.writeToFilePath(path.join(moduleMainDir, 'AndroidManifest.xml'));
// Generate Java file used to provide this module's JS source code to Titanium's JS runtime.
let fileContent = await fs.readFile(path.join(this.moduleTemplateDir, 'CommonJsSourceProvider.java'));
diff --git a/android/gradle.properties b/android/gradle.properties
index a5678e41a60..04ede8b4816 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -12,6 +12,3 @@ org.gradle.jvmargs=-Xmx1536m
# Note: Jetifier is not needed for test app since it doesn't use Google's deprecated support libraries.
android.useAndroidX=true
android.enableJetifier=false
-
-# remove if com.android.tools.build:gradle can be raised in /android/build.gradle
-android.suppressUnsupportedCompileSdk=33,34
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index e8be595e3c6..83dc05f6cc4 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
+#Tue Mar 19 21:28:34 EET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/android/kroll-apt/build.gradle b/android/kroll-apt/build.gradle
index addda9dcd4f..3254ac8abe3 100644
--- a/android/kroll-apt/build.gradle
+++ b/android/kroll-apt/build.gradle
@@ -7,8 +7,10 @@
apply plugin: 'java'
-sourceCompatibility = JavaVersion.VERSION_11
-targetCompatibility = JavaVersion.VERSION_11
+java {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+}
// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
// Will trigger a build failure if any violations have been detected.
@@ -55,6 +57,7 @@ tasks.withType(JavaCompile).configureEach {
// building with JDK newer than the Java version we're targeting. (Ex: Build with JDK 8, but target Java 7.)
// Note: Build tool wants a reference to runtime JAR of the same version we're targeting. Not going to happen.
options.compilerArgs << '-Xlint:-options'
+ options.incremental = true
}
// Bundle the below library dependencies within this project's built JAR.
diff --git a/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java b/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
index e97abe907c0..c87aa4cbc06 100644
--- a/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
+++ b/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
@@ -37,7 +37,7 @@
import org.json.simple.JSONValue;
-@SupportedSourceVersion(SourceVersion.RELEASE_11)
+@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SuppressWarnings("unchecked")
@SupportedAnnotationTypes({
KrollJSONGenerator.Kroll_argument,
diff --git a/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors b/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors
new file mode 100644
index 00000000000..ea6589826e0
--- /dev/null
+++ b/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors
@@ -0,0 +1 @@
+org.appcelerator.kroll.annotations.generator.KrollJSONGenerator,dynamic
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
index d2536898cfc..5d8fcda701e 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
@@ -30,11 +30,11 @@
import com.google.android.material.textfield.TextInputLayout;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
+import com.google.android.material.R;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollFunction;
import org.appcelerator.kroll.annotations.Kroll;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiDimension;
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
index 769de54feeb..3d2792f5bb0 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
@@ -29,11 +29,11 @@
import com.google.android.material.color.MaterialColors;
import java.lang.ref.WeakReference;
import org.appcelerator.titanium.proxy.TiViewProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.util.TiExifOrientation;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.util.TiColorHelper;
import ti.modules.titanium.media.MediaModule;
+import com.google.android.material.R;
public class TiImageView extends ViewGroup
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
index 5f56dcb2dfc..8bccff9f97d 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
@@ -20,12 +20,12 @@
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.view.TiUIView;
+import com.google.android.material.R;
public class TiUIActivityIndicator extends TiUIView
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
index 6d5a773221e..a6b21eea233 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
@@ -20,11 +20,11 @@
import androidx.appcompat.widget.AppCompatButton;
import com.google.android.material.button.MaterialButton;
+import com.google.android.material.R;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
index cc9f66c6c3c..97aaf7a05ec 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
@@ -156,10 +156,10 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
// Create a button with given settings and add it to view group.
Context context = buttonGroup.getContext();
- int attributeId = R.attr.materialButtonOutlinedStyle;
+ int attributeId = com.google.android.material.R.attr.materialButtonOutlinedStyle;
if (title.isEmpty() && (imageDrawable != null)) {
context = new ContextThemeWrapper(context, R.style.Widget_Titanium_OutlinedButton_IconOnly);
- attributeId = R.attr.materialButtonToggleGroupStyle;
+ attributeId = com.google.android.material.R.attr.materialButtonToggleGroupStyle;
}
MaterialButton button = new MaterialButton(context, null, attributeId);
button.setText(title);
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
index cc18e9b3e95..6d7f70b8e52 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
@@ -200,10 +200,10 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
// Create a button with given settings and add it to view group.
Context context = buttonGroup.getContext();
- int attributeId = R.attr.materialButtonOutlinedStyle;
+ int attributeId = com.google.android.material.R.attr.materialButtonOutlinedStyle;
if (title.isEmpty() && (imageDrawable != null)) {
context = new ContextThemeWrapper(context, R.style.Widget_Titanium_OutlinedButton_IconOnly);
- attributeId = R.attr.materialButtonToggleGroupStyle;
+ attributeId = com.google.android.material.R.attr.materialButtonToggleGroupStyle;
}
MaterialButton button = new MaterialButton(context, null, attributeId);
button.setEnabled(isEnabled);
@@ -217,8 +217,8 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
new int[] { android.R.attr.state_checked },
},
new int[] {
- oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface),
- col
+ oldColors.getColorForState(new int[] { -android.R.attr.state_checked },
+ com.google.android.material.R.attr.colorOnSurface), col
}
);
button.setBackgroundTintList(trackStates);
@@ -232,8 +232,8 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
new int[] { android.R.attr.state_checked },
},
new int[] {
- oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface),
- col
+ oldColors.getColorForState(new int[] { -android.R.attr.state_checked },
+ com.google.android.material.R.attr.colorOnSurface), col
}
);
button.setStrokeColor(trackStates);
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
index 8ca71d59e4b..24685db76f5 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
@@ -451,6 +451,6 @@ private int getTabCount()
@ColorInt
private static int getTabRippleColorFrom(Context context)
{
- return MaterialColors.getColor(context, R.attr.colorPrimary, Color.DKGRAY);
+ return MaterialColors.getColor(context, com.google.android.material.R.attr.colorPrimary, Color.DKGRAY);
}
}
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
index da19265a5b2..6de91925c5e 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
@@ -15,7 +15,6 @@
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiDimension;
@@ -57,6 +56,7 @@
import android.widget.TextView.OnEditorActionListener;
import androidx.appcompat.view.ContextThemeWrapper;
import com.google.android.material.textfield.TextInputLayout;
+import com.google.android.material.R;
public class TiUIText extends TiUIView implements TextWatcher, OnEditorActionListener, OnFocusChangeListener
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
index ed14fd3f194..e0a223b7ce6 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
@@ -64,8 +64,9 @@ public TiRecyclerViewHolder(final Context context, final ViewGroup viewGroup)
{
super(viewGroup);
- COLOR_NORMAL = MaterialColors.getColor(context, R.attr.colorButtonNormal, Color.DKGRAY);
- COLOR_PRIMARY = MaterialColors.getColor(context, R.attr.colorPrimary, Color.DKGRAY);
+ COLOR_NORMAL = MaterialColors.getColor(context, com.google.android.material
+ .R.attr.colorButtonNormal, Color.DKGRAY);
+ COLOR_PRIMARY = MaterialColors.getColor(context, com.google.android.material.R.attr.colorPrimary, Color.DKGRAY);
COLOR_SELECTED = ColorUtils.setAlphaComponent(COLOR_PRIMARY, 20);
if (resources == null) {
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
index 9730dc4f64a..db672c19881 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
@@ -19,7 +19,6 @@
import androidx.appcompat.widget.SearchView;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
@@ -27,6 +26,7 @@
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.view.TiUIView;
import ti.modules.titanium.ui.UIModule;
+import com.google.android.material.R;
public class TiUISearchBar extends TiUIView
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
index 67957c1309b..57d27a4ebab 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
@@ -33,7 +33,6 @@
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.ActivityProxy;
@@ -51,6 +50,7 @@
import ti.modules.titanium.ui.TabGroupProxy;
import ti.modules.titanium.ui.TabProxy;
+import com.google.android.material.R;
/**
* Abstract class representing Tab Navigation in Titanium. Abstract methods in it
diff --git a/android/settings.gradle b/android/settings.gradle
index 8f0aafe7ada..80822af59ec 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,4 +1,2 @@
rootProject.name = 'TitaniumSDK'
-include ':app'
-include ':kroll-apt'
-include ':titanium'
+include ':app', ':kroll-apt', ':titanium'
diff --git a/android/templates/build/AndroidManifest.xml b/android/templates/build/AndroidManifest.xml
index 13b2d98ca66..c74fc72ff2b 100644
--- a/android/templates/build/AndroidManifest.xml
+++ b/android/templates/build/AndroidManifest.xml
@@ -1,7 +1,6 @@
<% if (usesPermissions) { for (const nextPermission of usesPermissions) { %>
diff --git a/android/templates/build/app.build.gradle b/android/templates/build/app.build.gradle
index 44f859dfa54..dcb91f38827 100644
--- a/android/templates/build/app.build.gradle
+++ b/android/templates/build/app.build.gradle
@@ -14,6 +14,7 @@ repositories {
android {
compileSdkVersion <%- compileSdkVersion %>
+ namespace '<%- applicationId %>'
defaultConfig {
applicationId '<%- applicationId %>'
minSdkVersion <%- minSdkVersion %>
@@ -35,8 +36,11 @@ android {
<% } %>
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ buildFeatures {
+ buildConfig true
}
signingConfigs {
def tiKeystoreFilePath = <%- "'" + tiSdkAndroidDir.replace(/\\/g, '\\\\') + "/dev_keystore'" %>
diff --git a/android/templates/build/root.build.gradle b/android/templates/build/root.build.gradle
index c8b563a07cc..d400cc80468 100644
--- a/android/templates/build/root.build.gradle
+++ b/android/templates/build/root.build.gradle
@@ -1,14 +1,13 @@
-
buildscript {
- ext.kotlin_version = '1.8.20'
+ ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.4'
- classpath 'com.google.gms:google-services:4.3.10'
+ classpath 'com.android.tools.build:gradle:8.3.1'
+ classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
diff --git a/android/templates/build/ti.constants.gradle b/android/templates/build/ti.constants.gradle
index 503c2f006f1..6988acc5601 100644
--- a/android/templates/build/ti.constants.gradle
+++ b/android/templates/build/ti.constants.gradle
@@ -6,7 +6,8 @@
*/
project.ext {
- tiAndroidXAppCompatLibVersion = '1.6.1'
+ tiNdkVersion = '26.2.11394342'
+ tiAndroidXAppCompatLibVersion = '1.4.1'
tiAndroidXCoreLibVersion = '1.9.0'
tiAndroidXFragmentLibVersion = '1.5.7'
tiMaterialLibVersion = '1.6.1'
diff --git a/android/templates/module/generated/build.gradle b/android/templates/module/generated/build.gradle
index 35106af223b..9a54bd32738 100644
--- a/android/templates/module/generated/build.gradle
+++ b/android/templates/module/generated/build.gradle
@@ -16,9 +16,10 @@ def tiModuleBindingsJsonPath = "${buildDir}/ti-generated/json/<%- moduleName %>.
android {
compileSdkVersion <%- compileSdkVersion %>
- ndkVersion '22.1.7171670'
+ namespace '<%- moduleId %>'
+ ndkVersion '26.2.11394342'
defaultConfig {
- minSdkVersion 19
+ minSdkVersion 21
targetSdkVersion <%- compileSdkVersion %>
versionName '<%- moduleVersion %>'
@@ -69,6 +70,9 @@ android {
abiFilters <%- "'" + moduleArchitectures.join("','") + "'" %>
}
}
+ buildFeatures {
+ buildConfig true
+ }
externalNativeBuild {
ndkBuild {
path "${projectDir}/src/main/jni/Android.mk"
@@ -124,11 +128,11 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = "11"
+ jvmTarget = "17"
}
// Exclude the C++ runtime and Titanium kroll libraries for all architectures when packaging the AAR file.
// Avoids app build failure due to library file name collision. (Apps will use "titanium.aar" bundled *.so files.)
@@ -157,10 +161,19 @@ preBuild.doFirst {
// Set up project to compile Java side before compiling the C/C++ side.
// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
project.afterEvaluate {
- externalNativeBuildDebug.dependsOn compileDebugJavaWithJavac
- externalNativeBuildRelease.dependsOn compileReleaseJavaWithJavac
- buildNdkBuildDebug.dependsOn compileDebugJavaWithJavac
- buildNdkBuildRelease.dependsOn compileReleaseJavaWithJavac
+ tasks.configureEach {
+ if (it.name == 'compileReleaseJavaWithJavac') {
+ externalNativeBuildRelease.mustRunAfter it
+ } else if (it.name == 'compileDebugJavaWithJavac') {
+ externalNativeBuildDebug.mustRunAfter it
+ } else if (it.name == 'buildNdkBuildRelease[armeabi-v7a]' || it.name == 'buildNdkBuildRelease[arm64-v8a]' || it.name == 'buildNdkBuildRelease[x86]' || it.name == 'buildNdkBuildRelease[x86_64]') {
+ it.mustRunAfter('compileReleaseJavaWithJavac')
+ } else if (it.name == 'buildNdkBuildDebug[armeabi-v7a]' || it.name == 'buildNdkBuildDebug[arm64-v8a]' || it.name == 'buildNdkBuildDebug[x86]' || it.name == 'buildNdkBuildDebug[x86_64]') {
+ it.mustRunAfter('compileDebugJavaWithJavac')
+ } else if (it.name == 'generateReleaseAssets') {
+ it.dependsOn generateReleaseRFile
+ }
+ }
}
// Hook into Java compile task.
@@ -178,7 +191,7 @@ tasks.withType(JavaCompile).configureEach {
environment 'TI_MODULE_GENERATED_JS_DIR', "${projectDir}/build/ti-generated/js"
environment 'TI_MODULE_ID', '<%- moduleId %>'
environment 'TI_MODULE_NAMESPACE', '<%- moduleId.toLowerCase() %>'
- environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, '\\\\') %>'
+ environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, ' \ \ \ \ ') %>'
executable = 'node'
workingDir = projectDir
args = ['generate-cpp-files.js']
diff --git a/android/titanium/AndroidManifest.xml b/android/titanium/AndroidManifest.xml
index 300b87bd3b2..98a8989b5f8 100644
--- a/android/titanium/AndroidManifest.xml
+++ b/android/titanium/AndroidManifest.xml
@@ -1,39 +1,40 @@
-
+
+
+ android:configChanges="${tiActivityConfigChanges}"
+ android:exported="false" />
+ android:exported="false"
+ android:theme="@style/Theme.AppDerived.Translucent" />
+ android:exported="false"
+ android:theme="@style/Theme.Titanium.Dark.Fullscreen" />
+ android:exported="false"
+ android:theme="@style/Theme.Titanium.Dark.Fullscreen" />
+ android:exported="false"
+ android:theme="@style/Theme.AppDerived.Fullscreen" />
+ android:exported="false" />
+ android:grantUriPermissions="true" />
diff --git a/android/titanium/build.gradle b/android/titanium/build.gradle
index 2e78280442e..c3078c48701 100644
--- a/android/titanium/build.gradle
+++ b/android/titanium/build.gradle
@@ -1,4 +1,5 @@
import com.android.build.gradle.tasks.ExternalNativeCleanTask
+import com.android.build.gradle.tasks.ExternalNativeBuildTask
import groovy.json.JsonSlurper
/**
@@ -11,6 +12,7 @@ import groovy.json.JsonSlurper
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
+
// Fetch Titanium version info to be applied to generated "BuildConfig" Java class and published AAR.
// Prefer environment variables assigned via build/package scripts under "titanium_mobile/build" folder.
def tiBuildVersionString = System.env.TI_SDK_BUILD_VERSION
@@ -41,8 +43,10 @@ for (nextString in tiBuildVersionString.split('\\.')) {
}
android {
- compileSdkVersion 33
+ ndkVersion project.ext.tiNdkVersion
+ namespace 'org.appcelerator.titanium'
defaultConfig {
+ compileSdk 33
minSdkVersion 21
targetSdkVersion 34
versionName tiBuildVersionString
@@ -58,8 +62,8 @@ android {
// Also have it produce a JSON file of all bindings to be used by module build system.
arguments = [
'kroll.outputJsonFilePath': "${projectDir}/../../dist/android/titanium.bindings.json".toString(),
- 'kroll.outputCppDirPath': "${projectDir}/../runtime/v8/generated".toString(),
- 'kroll.jsModuleName': 'titanium'
+ 'kroll.outputCppDirPath' : "${projectDir}/../runtime/v8/generated".toString(),
+ 'kroll.jsModuleName' : 'titanium'
]
}
}
@@ -72,6 +76,9 @@ android {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
+ buildFeatures {
+ buildConfig true
+ }
externalNativeBuild {
cmake {
version '3.22.1'
@@ -86,41 +93,36 @@ android {
"${projectDir}/../modules/ui/assets"
]
java.srcDirs = [
- 'src/java',
- "${projectDir}/../modules/accelerometer/src/java",
- "${projectDir}/../modules/analytics/src/java",
- "${projectDir}/../modules/android/src/java",
- "${projectDir}/../modules/app/src/java",
- "${projectDir}/../modules/calendar/src/java",
- "${projectDir}/../modules/contacts/src/java",
- "${projectDir}/../modules/database/src/java",
- "${projectDir}/../modules/filesystem/src/java",
- "${projectDir}/../modules/geolocation/src/java",
- "${projectDir}/../modules/gesture/src/java",
- "${projectDir}/../modules/locale/src/java",
- "${projectDir}/../modules/media/src/java",
- "${projectDir}/../modules/network/src/java",
- "${projectDir}/../modules/platform/src/java",
- "${projectDir}/../modules/ui/src/java",
- "${projectDir}/../modules/utils/src/java",
- "${projectDir}/../modules/xml/src/java",
- "${projectDir}/../runtime/common/src/java",
- "${projectDir}/../runtime/v8/src/java"
- ]
- jni.srcDirs = [
- "${projectDir}/../runtime/v8/src/native",
- "${projectDir}/../runtime/v8/src/native/modules",
- "${projectDir}/../runtime/v8/generated"
+ 'src/java',
+ "${projectDir}/../modules/accelerometer/src/java",
+ "${projectDir}/../modules/analytics/src/java",
+ "${projectDir}/../modules/android/src/java",
+ "${projectDir}/../modules/app/src/java",
+ "${projectDir}/../modules/calendar/src/java",
+ "${projectDir}/../modules/contacts/src/java",
+ "${projectDir}/../modules/database/src/java",
+ "${projectDir}/../modules/filesystem/src/java",
+ "${projectDir}/../modules/geolocation/src/java",
+ "${projectDir}/../modules/gesture/src/java",
+ "${projectDir}/../modules/locale/src/java",
+ "${projectDir}/../modules/media/src/java",
+ "${projectDir}/../modules/network/src/java",
+ "${projectDir}/../modules/platform/src/java",
+ "${projectDir}/../modules/ui/src/java",
+ "${projectDir}/../modules/utils/src/java",
+ "${projectDir}/../modules/xml/src/java",
+ "${projectDir}/../runtime/common/src/java",
+ "${projectDir}/../runtime/v8/src/java"
]
res.srcDirs = [
- 'res',
- "${projectDir}/../modules/ui/res"
+ 'res',
+ "${projectDir}/../modules/ui/res"
]
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
}
@@ -151,6 +153,7 @@ tasks.register('updateV8Library') {
}
}
}
+
preBuild.dependsOn updateV8Library
tasks.withType(ExternalNativeCleanTask).configureEach {
dependsOn updateV8Library
@@ -164,35 +167,17 @@ tasks.withType(Checkstyle).configureEach {
classpath = files()
source android.sourceSets.main.java.srcDirs
}
+
// Execute Checkstyle on all files
tasks.register('checkJavaStyle', Checkstyle) {
// include '**/*.java'
}
+
// Execute Checkstyle on all modified files
tasks.register('checkstyleChanged', Checkstyle) {
include getChangedFiles()
}
-// Used to strip the src dir prefixes from the changed java files
-def getChangedFiles() {
- if (!project.hasProperty('changedFiles')) {
- return new ArrayList<>()
- }
- def allFiles = project.changedFiles.split(',')
-
- // Remove the prefix
- List files = new ArrayList<>()
- for (file in allFiles) {
- def index = file.indexOf('src/java/')
- if (index != -1) {
- files.add(file.substring(index + 9))
- }
- }
-
- // Return the list of touched files
- files
-}
-
// Performs a transpile/polyfill/rollup of our "titanium_mobile/common/Resources" directory tree's JS files,
// takes a V8 snapshot of rolled-up files, and then generates a C++ header file of that snapshot to be compiled-in.
// Note: This supports incremental builds. Only executes when JS files change or snapshot output file is missing.
@@ -201,7 +186,7 @@ tasks.register('snapshotTiCommonFiles') {
inputs.file "${projectDir}/../../build/lib/builder.js"
inputs.file "${projectDir}/../../build/lib/android/index.js"
outputs.file "${projectDir}/../runtime/v8/generated/V8Snapshots.h"
- doLast {
+ doFirst {
exec {
executable = 'node'
workingDir = projectDir
@@ -210,15 +195,6 @@ tasks.register('snapshotTiCommonFiles') {
}
}
-// Set up project to compile Java side before compiling the C/C++ side.
-// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
-project.afterEvaluate {
- externalNativeBuildDebug.dependsOn compileDebugJavaWithJavac
- externalNativeBuildRelease.dependsOn compileReleaseJavaWithJavac
- buildCMakeDebug.dependsOn compileDebugJavaWithJavac
- buildCMakeRelWithDebInfo.dependsOn compileReleaseJavaWithJavac
-}
-
// Runs our "prebuild.js" script before the C/C++ compile, but after Java compile. (Mid-build script?)
// Generates C/C++ files providing our Android-only JS files via byte arrays.
tasks.withType(JavaCompile).configureEach {
@@ -233,6 +209,61 @@ tasks.withType(JavaCompile).configureEach {
}
}
+// Set up project to compile Java side before compiling the C/C++ side.
+// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
+project.afterEvaluate {
+ tasks.configureEach {
+ if (it.name == 'compileReleaseJavaWithJavac') {
+ externalNativeBuildRelease.mustRunAfter it
+ } else if (it.name == 'compileDebugJavaWithJavac') {
+ externalNativeBuildDebug.mustRunAfter it
+ } else if (it.name == 'buildCMakeRelWithDebInfo[armeabi-v7a]' || it.name == 'buildCMakeRelWithDebInfo[arm64-v8a]' || it.name == 'buildCMakeRelWithDebInfo[x86]' || it.name == 'buildCMakeRelWithDebInfo[x86_64]') {
+ it.mustRunAfter('compileReleaseJavaWithJavac')
+ } else if (it.name == 'buildCMakeDebug[armeabi-v7a]' || it.name == 'buildCMakeDebug[arm64-v8a]' || it.name == 'buildCMakeDebug[x86]' || it.name == 'buildCMakeDebug[x86_64]') {
+ it.mustRunAfter('compileDebugJavaWithJavac')
+ } else if (it.name == 'generateReleaseAssets') {
+ it.dependsOn generateReleaseRFile
+ }
+ }
+}
+
+tasks.withType(ExternalNativeBuildTask).configureEach {
+ it.mustRunAfter snapshotTiCommonFiles
+}
+
+tasks.withType(ExternalNativeCleanTask).configureEach {
+ dependsOn updateV8Library
+}
+
+// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
+// Will trigger a build failure if any violations have been detected.
+// Customize all the Checkstyle tasks
+tasks.withType(Checkstyle).configureEach {
+ // Specify all files that should be checked
+ classpath = files()
+ source android.sourceSets.main.java.srcDirs
+}
+
+// Used to strip the src dir prefixes from the changed java files
+def getChangedFiles() {
+ if (!project.hasProperty('changedFiles')) {
+ return new ArrayList<>()
+ }
+ def allFiles = project.changedFiles.split(',')
+
+ // Remove the prefix
+ List files = new ArrayList<>()
+ for (file in allFiles) {
+ def index = file.indexOf('src/java/')
+ if (index != -1) {
+ files.add(file.substring(index + 9))
+ }
+ }
+
+ // Return the list of touched files
+ files
+}
+
clean.doLast {
// Delete generated C/C++ files.
project.delete file("${projectDir}/../runtime/v8/generated")
@@ -251,7 +282,7 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.core:core:${project.ext.tiAndroidXCoreLibVersion}"
implementation 'androidx.drawerlayout:drawerlayout:1.2.0'
- implementation 'androidx.exifinterface:exifinterface:1.3.6'
+ implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation "androidx.fragment:fragment:${project.ext.tiAndroidXFragmentLibVersion}"
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
@@ -261,7 +292,7 @@ dependencies {
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
- implementation 'androidx.annotation:annotation:1.5.0'
+ implementation 'androidx.annotation:annotation:1.7.1'
// Google's "Material Components" themed UI library.
implementation "com.google.android.material:material:${project.ext.tiMaterialLibVersion}"
@@ -269,7 +300,7 @@ dependencies {
// The Google Play Services libraries are only used by Titanium's geolocation feature.
// We link to them dynamically at runtime. So, they can be safely excluded when in the app project.
implementation "com.google.android.gms:play-services-base:${project.ext.tiPlayServicesBaseLibVersion}"
- implementation 'com.google.android.gms:play-services-location:21.0.1'
+ implementation 'com.google.android.gms:play-services-location:21.2.0'
// XML library providing XPath support to our Ti.XML APIs.
implementation 'jaxen:jaxen:1.2.0'
@@ -329,6 +360,7 @@ publishing {
}
}
}
+
publish.doLast {
// After above publishing step, extract C/C++ "*.so" libraries from AAR to "./build/outputs/jniLibs" directory.
def jniLibsOutputDir = "${buildDir}/outputs/jniLibs"
diff --git a/android/untar.gradle b/android/untar.gradle
index 145bb23b4eb..20822112eb4 100644
--- a/android/untar.gradle
+++ b/android/untar.gradle
@@ -1,36 +1,36 @@
-/**
- * Titanium SDK
- * Copyright TiDev, Inc. 04/07/2022-Present
- * Licensed under the terms of the Apache Public License.
- * Please see the LICENSE included with this distribution for details.
- */
-
-// Extracts a "*.tar" file using the same parameters as the ant task.
-// Used by our prebuild step to extract our "libv8-*.tar.bz2" file.
-tasks.register('untar') {
- // Throw an error if required gradle property has not been set.
- if (!project.hasProperty('src')) {
- throw new InvalidUserDataException('You must set a "src" property.')
- }
-
- // Assign a default value to any unassigned properties.
- if (!project.hasProperty('compression')) {
- project.ext.compression = 'none'
- }
- if (!project.hasProperty('overwrite')) {
- project.ext.overwrite = 'true'
- }
- if (!project.hasProperty('dest')) {
- def sourceFile = new File(src)
- project.ext.dest = sourceFile.getParentFile().getPath()
- }
-
- // Use "ant" to extract the given tarball.
- ant.untar(
- compression: project.properties.compression,
- overwrite: project.properties.overwrite,
- src: project.properties.src,
- dest: project.properties.dest)
-}
-
-defaultTasks 'untar'
\ No newline at end of file
+/**
+ * Titanium SDK
+ * Copyright TiDev, Inc. 04/07/2022-Present
+ * Licensed under the terms of the Apache Public License.
+ * Please see the LICENSE included with this distribution for details.
+ */
+
+// Extracts a "*.tar" file using the same parameters as the ant task.
+// Used by our prebuild step to extract our "libv8-*.tar.bz2" file.
+tasks.register('untar') {
+ // Throw an error if required gradle property has not been set.
+ if (!project.hasProperty('src')) {
+ throw new InvalidUserDataException('You must set a "src" property.')
+ }
+
+ // Assign a default value to any unassigned properties.
+ if (!project.hasProperty('compression')) {
+ project.ext.compression = 'none'
+ }
+ if (!project.hasProperty('overwrite')) {
+ project.ext.overwrite = 'true'
+ }
+ if (!project.hasProperty('dest')) {
+ def sourceFile = new File(src)
+ project.ext.dest = sourceFile.getParentFile().getPath()
+ }
+
+ // Use "ant" to extract the given tarball.
+ ant.untar(
+ compression: project.properties.compression,
+ overwrite: project.properties.overwrite,
+ src: project.properties.src,
+ dest: project.properties.dest)
+}
+
+defaultTasks 'untar'