Popular New Releases in SDK
WeiXinMPSDK
Senaprc.Weixin v6.14.5,Senparc.Weixin.MP v16.17.9 最后一个支持 .NET Framework 4.5.1 的版本
facebook-android-sdk
Facebook SDK sdk-version-13.1.0
operator-sdk
v1.19.1
Hearthstone-Deck-Tracker
v1.17.11
WeRoBot
Version 1.13.1
Popular Libraries in SDK
by JeffreySu csharp
7228 Apache-2.0
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
by facebook kotlin
5595 NOASSERTION
Used to integrate Android apps with Facebook Platform.
by operator-framework go
5577 Apache-2.0
SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
by golang go
4583 NOASSERTION
[mirror] Go on Mobile
by HearthSim csharp
4523
A deck tracker and deck manager for Hearthstone on Windows
by boostorg html
4498 BSL-1.0
Super-project for modularized Boost
by dodgepudding php
4471
微信公众平台php开发包, weixin developer SDK.
by offu python
4031 MIT
WeRoBot 是一个微信公众号开发框架
by cosmos go
3834 NOASSERTION
:chains: A Framework for Building High Value Public Blockchains :sparkles:
Trending New libraries in SDK
by Melvin-Abraham javascript
2764 Apache-2.0
A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
by awslabs rust
1524 Apache-2.0
AWS SDK for the Rust Programming Language
by raspberrypi c
1215 BSD-3-Clause
by microsoft c++
983 MIT
Tooling to generate metadata for Win32 APIs in the Windows SDK.
by bytedance java
864 Apache-2.0
BoostMultiDex is a solution for quickly loading multiple dex files on low Android version devices (4.X and below, SDK <21).
by alipay java
682 MIT
Alipay Easy SDK for multi-language(java、c#、php、ts etc.) allows you to enjoy a minimalist programming experience and quickly access the various high-frequency capabilities of the Alipay Open Platform.
by michaelhly python
509 MIT
Solana Python SDK
by fudiwei csharp
372 MIT
可能是目前全网最完整的 C# 版微信 SDK,封装全部已知的微信 API,支持公众平台(订阅号、服务号、小程序、小游戏、小商店)& 开放平台 & 商户平台(微信支付)& 企业微信(企业号)& 广告平台(广点通)& 对话开放平台(微信智能对话)等模块,可跨平台。持续随官方更新,欢迎 Star / Fork。QQ 交流群 875580418。
by tylov c
305 MIT
A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.
Top Authors in SDK
1
71 Libraries
10269
2
67 Libraries
10180
3
46 Libraries
4792
4
45 Libraries
1848
5
31 Libraries
1373
6
27 Libraries
601
7
21 Libraries
234
8
20 Libraries
179
9
19 Libraries
1657
10
19 Libraries
1363
1
71 Libraries
10269
2
67 Libraries
10180
3
46 Libraries
4792
4
45 Libraries
1848
5
31 Libraries
1373
6
27 Libraries
601
7
21 Libraries
234
8
20 Libraries
179
9
19 Libraries
1657
10
19 Libraries
1363
Trending Kits in SDK
No Trending Kits are available at this moment for SDK
Trending Discussions on SDK
Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro
Error: MainActivity must extend android.app.Activity [Instantiatable]
Android Studio Bumblebee Wifi pairing Issue
How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)?
Publish error: Found multiple publish output files with the same relative path
Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)
IntelliJ - Invalid source release: 17
Action requested: Declare your Ad ID permission
Error when trying to run my React Native app on Android
Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)
QUESTION
Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro
Asked 2022-Apr-04 at 18:41I've got a project that is working fine in windows os but when I switched my laptop and opened an existing project in MacBook Pro M1. I'm unable to run an existing android project in MacBook pro M1. first I was getting
Execution failed for task ':app:kaptDevDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang.reflect.InvocationTargetException (no error message)
this error was due to the Room database I applied a fix that was adding below library before Room database and also changed my JDK location from file structure from JRE to JDK.
kapt "org.xerial:sqlite-jdbc:3.34.0"
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6
after that now I'm getting an issue which is Unknown host CPU architecture: arm64
there is an SDK in my project that is using this below line.
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16
App Gradle
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23
[CXX1405] error when building with ndkBuild using /Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk: Build command failed. Error while executing process /Users/mac/Library/Android/sdk/ndk/21.4.7075529/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/obj NDK_LIBS_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} ERROR: Unknown host CPU architecture: arm64
which is causing this issue and whenever I comment on this line
path 'Android.mk'
it starts working fine, is there any way around which will help me run this project with this piece of code without getting this NDK issue?
Update - It seems that Room got fixed in the latest updates, Therefore you may consider updating Room to latest version (2.3.0-alpha01 / 2.4.0-alpha03 or above)
ANSWER
Answered 2022-Apr-04 at 18:41To solve this on a Apple Silicon M1 I found three options
AUse NDK 24
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27
You can install it with
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28
or
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29
Depending what where sdkmanager
is located
Change your ndk-build
to use Rosetta x86. Search for your installed ndk with
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30
eg
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31
and change
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31DIR="$(cd "$(dirname "$0")" && pwd)"
32$DIR/build/ndk-build "$@"
33
to
1 //Room components
2 kapt "org.xerial:sqlite-jdbc:3.34.0"
3 implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4 kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5 androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7 externalNativeBuild {
8 ndkBuild {
9 path 'Android.mk'
10 }
11 }
12 ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17 cmake {
18 path "src/main/cpp/CMakeLists.txt"
19 version "3.18.1"
20 //version "3.10.2"
21 }
22 }
23android {
24 ndkVersion "24.0.8215888"
25 ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31DIR="$(cd "$(dirname "$0")" && pwd)"
32$DIR/build/ndk-build "$@"
33DIR="$(cd "$(dirname "$0")" && pwd)"
34arch -x86_64 /bin/bash $DIR/build/ndk-build "$@"
35
QUESTION
Error: MainActivity must extend android.app.Activity [Instantiatable]
Asked 2022-Mar-31 at 02:13I tried upgrading Android Gradle Plugin from 4.2.2 to 7.0.1 using the upgrade assistant which is available in Android Studio at Tools > AGP Upgrade Assistant. The only change it made was to my project-level build.gradle file:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11
However, now when I run ./gradlew assemble assembleAndroidTest
I get the following error:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32
My project is multi-module, but I don't suspect that as the problem since it's complaining about the application module, not a library module.
I believe my <activity>
tag is well formed in my AndroidManifest.xml for my application module:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42
Furthermore, I don't think there is anything wrong with extending AppCompatActivity
instead of android.app.Activity
as I'm doing in my MainActivity.kt:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47
I'm concerned that Android Gradle Plugin 7.0.1 is not really ready for prime-time because the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0'
instead of 7.0.1.
I saw that the Android Gradle Plugin 7.0.1 release notes mentioned some changes to linting but none of those changes seemed relevant to me.
I also skimmed through the Android Gradle Plugin source code to see if I could find the linting stage any identify any changes but it looked like a lot of work to find that code and do that analysis.
I searched for answers but all I could find were these two stackoverflow entries where the error was legitimate and the programmer just needed to change their code to ensure they were referencing an actual Activity
:
- Android Studio Error: Activity must extend android.app.activity
- MainActivity cannot be cast to android.app.Activity
I also tried Android Gradle Plugin 7.0.0 but got the same error. Only Android Gradle Plugin 4.2.2 prevents the error.
Is this a bug in Android Gradle Plugin 7.0.1?
Update: could not disable Instantiatable
I tried to disable the Instantiatable
lint error the following ways but none of them prevented the error.
First, I tried adding disable "Instantiatable"
to my application-level build.gradle file:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52
Second, I tried prepending @SdkSuppress("Instantiatable")
to the class:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52@SdkSuppress("Instantiatable")
53class MainActivity : AppCompatActivity() {
54 // ...
55}
56
Similarly, I tried @SuppressLint("Instantiatable")
but that didn't work either.
ANSWER
Answered 2021-Aug-24 at 16:35the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0' instead of 7.0.1.
You need to read further down the page, to this and this. That table is only relevant for pre-7.0.0 versions.
Is this a bug in Android Gradle Plugin 7.0.1?
Quite possibly. Or, perhaps beyond, as the Instantiatable
Lint check has a history of problems.
If your scenario does not match one of those three August 2021 bugs, and you are in position to provide a reproducible test case, file a fresh issue! Beyond that, if a clean-and-rebuild is not clearing up your problem, you might need to simply disable the Instantiatable
Lint check for the time being by adding the following to all of your build.gradle files at the application or library level (i.e. all except your project-level build.gradle):
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52@SdkSuppress("Instantiatable")
53class MainActivity : AppCompatActivity() {
54 // ...
55}
56android {
57 lintOptions {
58 disable "Instantiatable"
59 }
60}
61
QUESTION
Android Studio Bumblebee Wifi pairing Issue
Asked 2022-Mar-29 at 15:31I have used Android Studio Bumblebee's latest function (Wifi pairing) for 2 - 3 days before it stopped working.
I am now receiving the error "This system does not meet the requirements to support Wi-Fi pairing. Please update to the latest version of "platform-tools" using the SDK manager"
I have updated everything to the latest version.
ANSWER
Answered 2022-Feb-02 at 03:53My guess is that you have an old version of platform-tools/adb installed somewhere (you can verify this by running which adb
in your command prompt).
You can find the pathway to the platform-tools/adb you want to use in Android Studios under Settings -> Appearance & Behavior -> System Settings -> Android SDK.
Inside of this folder should be another folder called "platform-tools".
Update your PATH You'll want to add this folder to your PATH and remove the old one. Restart Android Studio For the changes to take effect, you'll need to restart the IDE.File -> Invalidate Caches -> Invalidate and Restart
Another Solution If the above doesn't work, you can also uninstall and reinstall platform-tools using the sdkmanager command.1sdkmanager --uninstall "platform-tools"
2
Once platform-tools is uninstalled, you can use the SDK Manager in Android Studio to reinstall.
QUESTION
How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)?
Asked 2022-Mar-21 at 16:27Dart SDK officially supports ARM64 and as of now, 2.14.2 is the latest (stable) Dart SDK that has support for ARM64. Though it was the same version that was bundled in my Flutter setup, it seemed to run on Intel architecture (Activity monitor shows dart processes running on Intel).
I manually tried replacing the dart SDK on my flutter installation bu replacing flutter-directory/bin/cache/dart-sdk/
with the contents of a zip file of the Dart SDK made for ARM64, downloaded from dart.dev archive. But trying to run an app on an Android emulator (which runs on ARM64 and was working on my old Flutter setup), throws this error:
1Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
2lib/main.dart:1
3Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments
4no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers
5use_bare_instructions no-dedup_instructions
6no-"asserts" "use_field_guards" "use_osr" x64-sysv no-null-safety' but the VM has 'release no-code_comments no-
7dwarf_stack_traces_mode lazy_async_stacks
8lazy_dispatchers use_bare_instructions no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" arm64-sysv no-null-safety'
92
10the Dart compiler exited unexpectedly.
11
12
Is there any other way to do a completely ARM64 Flutter setup on M1 devices?
Flutter version 2.5.1
Dart version 2.14.2
Device: MacBook Air (M1, 2020)
ANSWER
Answered 2021-Sep-29 at 17:46It seems it can't be used with Flutter yet, as seen in:
Apple Silicon support in the Dart SDK
[...] Note that the Dart SDK bundled in the Flutter SDK doesn’t have these improvements yet.
https://medium.com/dartlang/announcing-dart-2-14-b48b9bb2fb67
[Announcing Dart 2.14][ScreenShot]: https://i.stack.imgur.com/N8Qcc.png
And:
Get the Dart SDK
[...] As of Flutter 1.21, the Flutter SDK includes the full Dart SDK. So if you have Flutter installed, you might not need to explicitly download the Dart SDK. Consider downloading the Dart SDK if any of the following are true:
- You don’t use Flutter.
- You use a pre-1.21 version of Flutter.
- You want to reduce disk space requirements or download time, and your use case doesn’t require Flutter. For example, you might have a continuous integration (CI) setup that requires Dart but not Flutter.
[Get the Dart SDK][ScreenShot]: https://i.stack.imgur.com/rawJV.png
QUESTION
Publish error: Found multiple publish output files with the same relative path
Asked 2022-Mar-21 at 05:58When I publish my ABP project I get the following error:
1C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path:
2
3D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\compilerconfig.json,
4D:\Github\volo\abp\bookstore\src\Acme.BookStore.Theme\compilerconfig.json,
5
6D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\package.json,
7D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\package.json.
8
9D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj
10
ANSWER
Answered 2022-Jan-13 at 21:59Issue:
The issue raises after .NET 6 migration. There's a new feature that blocks multiple files from being copied to the same target directory with the same file name. See https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/duplicate-files-in-output
Solution #1 (workaround):
You can add the following build property to all your publishable (*.Web) projects' *.csproj files. This property will bypass this check and works as previously, in .NET5.
1C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path:
2
3D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\compilerconfig.json,
4D:\Github\volo\abp\bookstore\src\Acme.BookStore.Theme\compilerconfig.json,
5
6D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\package.json,
7D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\package.json.
8
9D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj
10<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
11
Solution #2:
Exclude the problematic files to be copied to the output folder.
In this example we'll exclude these files: compilerconfig.json
and package.json
.
Add the following lines to your common.props
(located in the root directory of your solution):
1C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path:
2
3D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\compilerconfig.json,
4D:\Github\volo\abp\bookstore\src\Acme.BookStore.Theme\compilerconfig.json,
5
6D:\Github\volo\abp\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\package.json,
7D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\package.json.
8
9D:\Github\volo\abp\bookstore\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj
10<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
11<Content Remove="compilerconfig.json;package.json"/>
12<None Include="compilerconfig.json;package.json">
13 <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
14 <CopyToPublishDirectory>Never</CopyToPublishDirectory>
15</None>
16
QUESTION
Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)
Asked 2022-Mar-17 at 15:50I've just updated my flutter project packages to be null-safety compliant and now Android Studio wants me to update my project to use the latest version of Kotling Gradle Plugin. Can't see where to change this though. I have tried to change "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
into "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
but this has no effect.
My build.grade
-file looks like this:
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85
Build output:
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90
ANSWER
Answered 2022-Jan-30 at 21:52change build gradle to this :
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91
and gradle-wrapper to this :
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
92
QUESTION
IntelliJ - Invalid source release: 17
Asked 2022-Mar-17 at 13:46I've created a new Java project in IntelliJ with Gradle that uses Java 17. When running my app it has the error Cause: error: invalid source release: 17
.
My Settings
I've installed openjdk-17
through IntelliJ
and set it as my Project SDK
.
The Project language level
has been set to 17 - Sealed types, always-strict floating-point semantics
.
In Modules -> Sources
I've set the Language level
to Project default (17 - Sealed types, always strict floating-point semantics)
.
In Modules -> Dependencies
I've set the Module SDK
to Project SDK openjdk-17
.
In Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler
I've set the Project bytecode version
to 17
.
Gradle
1plugins {
2 id 'org.springframework.boot' version '2.5.6'
3 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4 id 'java'
5}
6
7group = 'com.app'
8version = '0.0.1-SNAPSHOT'
9sourceCompatibility = '17'
10
11repositories {
12 mavenCentral()
13}
14
15dependencies {
16 implementation 'org.springframework.boot:spring-boot-starter-web'
17 implementation 'org.springframework.boot:spring-boot-starter-websocket'
18 testImplementation 'org.springframework.boot:spring-boot-starter-test'
19 implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0'
20 implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
21}
22
23test {
24 useJUnitPlatform()
25}
26
I've looked at all of the answers here but I can't seem to fix this. I must be missing something but I can't find it. I've not had any problems using Java 8 or 11.
How do I resolve this?
ANSWER
Answered 2021-Oct-24 at 14:23The message typically entails that your JAVA_HOME environment variable points to a different Java version.
Here are the steps to follow:
- Close IntelliJ IDEA
- Open a terminal window and check your JAVA_HOME variable value:
- *nix system:
echo $JAVA_HOME
- Windows system:
echo %JAVA_HOME%
- *nix system:
- The JAVA_HOME path should be pointing to a different path, then set it to the openjdk-17 path:
- *nix system:
export JAVA_HOME=/path/to/openjdk-17
- Windows system:
set JAVA_HOME=path\to\openjdk-17
- *nix system:
- Open your project again in IntelliJ IDEA
- Make sure to set both source and target compatibility versions (not only the
sourceCompatibility
)
You should be able to build your project.
EDIT: Gradle ToolchainYou may need also to instruct Gradle to use a different JVM than the one it uses itself by setting the Java plugin toolchain to your target version:
1plugins {
2 id 'org.springframework.boot' version '2.5.6'
3 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4 id 'java'
5}
6
7group = 'com.app'
8version = '0.0.1-SNAPSHOT'
9sourceCompatibility = '17'
10
11repositories {
12 mavenCentral()
13}
14
15dependencies {
16 implementation 'org.springframework.boot:spring-boot-starter-web'
17 implementation 'org.springframework.boot:spring-boot-starter-websocket'
18 testImplementation 'org.springframework.boot:spring-boot-starter-test'
19 implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0'
20 implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
21}
22
23test {
24 useJUnitPlatform()
25}
26// build.gradle
27java {
28 toolchain {
29 languageVersion = JavaLanguageVersion.of(17)
30 }
31}
32
QUESTION
Action requested: Declare your Ad ID permission
Asked 2022-Mar-15 at 13:37Today i have got this email:
Last July, we announced Advertising policy changes to help bolster security and privacy. We added new restrictions on identifiers used by apps that target children. When users choose to delete their advertising ID in order to opt out of personalization advertising, developers will receive a string of zeros instead of the identifier if they attempt to access the identifier. This behavior will extend to phones, tablets, and Android TV starting April 1, 2022. We also announced that you need to declare an AD_ID permission when you update your app targeting API level to 31 (Android 12). Today, we are sharing that we will give developers more time to ease the transition. We will require this permission declaration when your apps are able to target Android 13 instead of starting with Android 12.
Action Items If you use an advertising ID, you must declare the AD_ID Permission when your app targets Android 13 or above. Apps that don’t declare the permission will get a string of zeros. Note: You’ll be able to target Android 13 later this year. If your app uses an SDK that has declared the Ad ID permission, it will acquire the permission declaration through manifest merge. If your app’s target audience includes children, you must not transmit Android Advertising ID (AAID) from children or users of unknown age.
My app is not using the Advertising ID. Should i declare the AD_ID
Permission in Manifest or not?
ANSWER
Answered 2022-Mar-14 at 20:51Google describe here how to solve
https://support.google.com/googleplay/android-developer/answer/6048248?hl=en
Add in manifest
1<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
2
QUESTION
Error when trying to run my React Native app on Android
Asked 2022-Mar-06 at 07:58I've built my React Native app and tested and troubleshooted with my iOS devices for months. Now I'm trying to built and test the app on Android for the first time. The thing is, that I keep getting errors trying to run the Android-version of my app. After hours of debugging and troubleshooting, I tried to create a new RN project and see if that could run on my emulator and device. I got that part working and then I wanted to copy/paste the files of my existing app project into the new project.
I pasted my existing assets, styles, the source JS-files and the package.json file into the new project, ran npm install
and then I ended up with the exact same error message as I had in the original project when I run react-native run-android
.
The full error message is here:
1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14 > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15 Searched in the following locations:
16 - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17 - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18 - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21 - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22 Required by:
23 project :app > com.facebook.react:react-native:0.64.2
24 > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25 Searched in the following locations:
26 - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27 - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28 - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31 - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32 Required by:
33 project :app > com.facebook.react:react-native:0.64.2
34 > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35 Searched in the following locations:
36 - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37 - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38 - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41 - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42 Required by:
43 project :app > project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52 at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53 at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54 at processTicksAndRejections (node:internal/process/task_queues:96:5)
55 at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56 at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57
I've tried to run ./gradlew clean
in the android-folder without any luck. My build.gradle-file looks like this:
1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14 > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15 Searched in the following locations:
16 - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17 - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18 - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21 - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22 Required by:
23 project :app > com.facebook.react:react-native:0.64.2
24 > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25 Searched in the following locations:
26 - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27 - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28 - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31 - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32 Required by:
33 project :app > com.facebook.react:react-native:0.64.2
34 > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35 Searched in the following locations:
36 - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37 - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38 - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41 - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42 Required by:
43 project :app > project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52 at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53 at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54 at processTicksAndRejections (node:internal/process/task_queues:96:5)
55 at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56 at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60 ext {
61 buildToolsVersion = "30.0.2"
62 minSdkVersion = 21
63 compileSdkVersion = 30
64 targetSdkVersion = 30
65 ndkVersion = "20.1.5948944"
66 kotlinVersion = "1.3.72"
67 }
68 repositories {
69 repositories {
70 google()
71 maven { url 'https://maven.google.com' }
72 mavenLocal()
73 mavenCentral()
74
75 // jcenter()
76 maven {
77 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78 url "$rootDir/../node_modules/react-native/android"
79 }
80 }
81 }
82 dependencies {
83 classpath("com.android.tools.build:gradle:4.2.1")
84 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
85 // NOTE: Do not place your application dependencies here; they belong
86 // in the individual module build.gradle files
87 }
88}
89
90allprojects {
91 repositories {
92 google()
93 mavenCentral()
94
95 mavenLocal()
96 maven {
97 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98 url("$rootDir/../node_modules/react-native/android")
99 }
100 maven {
101 // Android JSC is installed from npm
102 url("$rootDir/../node_modules/jsc-android/dist")
103 }
104
105 maven { url 'https://www.jitpack.io' }
106 }
107}
108
Please let me know if you know what to do or if you have experienced a similar issue!
ANSWER
Answered 2021-Aug-21 at 13:43I've hit this same issue and have temporarily resolved it by uninstalling react-native-video (npm uninstall --save react-native-video). That's not a great answer as I need that component, but I don't have a full solution yet. I think somehow com.yqritc:android-scalablevideoview:1.0.4. is required by react-native-video but has gotten lost or removed. Other thoughts are welcome.
UPDATE: Resolved! In your build.gradle in your Android folder you need to add the repository "jcenter()" in allprojects (not in build dependencies) like this...
1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14 > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15 Searched in the following locations:
16 - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17 - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18 - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21 - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22 Required by:
23 project :app > com.facebook.react:react-native:0.64.2
24 > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25 Searched in the following locations:
26 - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27 - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28 - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31 - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32 Required by:
33 project :app > com.facebook.react:react-native:0.64.2
34 > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35 Searched in the following locations:
36 - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37 - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38 - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40 - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41 - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42 Required by:
43 project :app > project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52 at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53 at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54 at processTicksAndRejections (node:internal/process/task_queues:96:5)
55 at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56 at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60 ext {
61 buildToolsVersion = "30.0.2"
62 minSdkVersion = 21
63 compileSdkVersion = 30
64 targetSdkVersion = 30
65 ndkVersion = "20.1.5948944"
66 kotlinVersion = "1.3.72"
67 }
68 repositories {
69 repositories {
70 google()
71 maven { url 'https://maven.google.com' }
72 mavenLocal()
73 mavenCentral()
74
75 // jcenter()
76 maven {
77 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78 url "$rootDir/../node_modules/react-native/android"
79 }
80 }
81 }
82 dependencies {
83 classpath("com.android.tools.build:gradle:4.2.1")
84 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
85 // NOTE: Do not place your application dependencies here; they belong
86 // in the individual module build.gradle files
87 }
88}
89
90allprojects {
91 repositories {
92 google()
93 mavenCentral()
94
95 mavenLocal()
96 maven {
97 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98 url("$rootDir/../node_modules/react-native/android")
99 }
100 maven {
101 // Android JSC is installed from npm
102 url("$rootDir/../node_modules/jsc-android/dist")
103 }
104
105 maven { url 'https://www.jitpack.io' }
106 }
107}
108allprojects {
109 repositories {
110 mavenCentral()
111 mavenLocal()
112 jcenter()
113}
114
QUESTION
Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)
Asked 2022-Mar-01 at 05:29Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem.
All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run
but still same issue. only on iOS simulator not deploying.
Any solution for this. Thanks in advance.
Error
1Launching lib/main.dart on iPhone 13 in debug mode...
2Running pod install... 5.3s
3Running Xcode build...
4Xcode build done. 104.1s
5Failed to build iOS app
6Error output from Xcode build:
7↳
8 objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
9 /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
10 objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
11 /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
12 ** BUILD FAILED **
13
flutter doctor -v
1Launching lib/main.dart on iPhone 13 in debug mode...
2Running pod install... 5.3s
3Running Xcode build...
4Xcode build done. 104.1s
5Failed to build iOS app
6Error output from Xcode build:
7↳
8 objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
9 /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
10 objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
11 /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
12 ** BUILD FAILED **
13[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
14 en-IN)
15 • Flutter version 2.8.1 at
16 /Users/macsystem/Documents/developer/flutter
17 • Upstream repository https://github.com/flutter/flutter.git
18 • Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
19 • Engine revision 890a5fca2e
20 • Dart version 2.15.1
21
22[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
23 • Android SDK at /Users/macsystem/Library/Android/sdk
24 • Platform android-32, build-tools 32.0.0
25 • Java binary at: /Applications/Android
26 Studio.app/Contents/jre/Contents/Home/bin/java
27 • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
28 • All Android licenses accepted.
29
30[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
31 • Xcode at /Applications/Xcode.app/Contents/Developer
32 • CocoaPods version 1.11.2
33
34[✓] Chrome - develop for the web
35 • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
36
37[✓] Android Studio (version 2020.3)
38 • Android Studio at /Applications/Android Studio.app/Contents
39 • Flutter plugin can be installed from:
40 🔨 https://plugins.jetbrains.com/plugin/9212-flutter
41 • Dart plugin can be installed from:
42 🔨 https://plugins.jetbrains.com/plugin/6351-dart
43 • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
44
45[✓] Connected device (2 available)
46 • iPhone 13 (mobile) • 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 • ios
47 • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
48 • Chrome (web) • chrome • web-javascript
49 • Google Chrome 97.0.4692.99
50
ANSWER
Answered 2022-Feb-02 at 04:43I have been facing this same issue for some time now. the same setup is working nicely in a mac with intel chip. But i have even done a resetup of my system, m1 mac still throws the same error.
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in SDK
Tutorials and Learning Resources are not available at this moment for SDK