Android NDK "Hello From C++" App Gives Error - android

I installed Android NDK,LLDB and CMake from SDK Manager after that I created a new project with C/C++ support in Android Studio.I didn't change anything and I run the project and I got error.
I got this error:
Android resource compilation failed
/home/ubuntu/Desktop/NdkWorkPlaces/nativeapp1/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:3: error: resource 'attr/android:font' has invalid entry name 'android:font'. Invalid character 'android:font'.
/home/ubuntu/Desktop/NdkWorkPlaces/nativeapp1/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:4: error: resource 'attr/android:fontStyle' has invalid entry name 'android:fontStyle'. Invalid character 'android:fontStyle'.
/home/ubuntu/Desktop/NdkWorkPlaces/nativeapp1/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:5: error: resource 'attr/android:fontVariationSettings' has invalid entry name 'android:fontVariationSettings'. Invalid character 'android:fontVariationSettings'.
/home/ubuntu/Desktop/NdkWorkPlaces/nativeapp1/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:6: error: resource 'attr/android:fontWeight' has invalid entry name 'android:fontWeight'. Invalid character 'android:fontWeight'.
/home/ubuntu/Desktop/NdkWorkPlaces/nativeapp1/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:7: error: resource 'attr/android:ttcIndex' has invalid entry name 'android:ttcIndex'. Invalid character 'android:ttcIndex'.
I can't try anything for solve this problem. What should I do ?

I solved my problem by changing the compileSdkVersion 28 to compileSdkVersion 27 , targetSdkVersion 28 to targetSdkVersion 27 and implementation 'com.android.support:appcompat-v7:28.0.0' to implementation 'com.android.support:appcompat-v7:27.1.1' in build.gradle(Module:app) file.
But still, I don't know why it doesn't work in the sdk version 28.

Related

React Native - Task :app:processReleaseMainManifest FAILED, error (aab) after changing to compileSdkVersion and targetSdkVersion to 31

After switching to compileSdkVersion = 31 due to GooglePlay changes (The target API level for your application is 30. To ensure the required performance and security, the target API level must be at least 31. Change the target API level for the application so that it becomes at least 31). Not going to bundle. My actions:
changed in build.gradle file
"compileSdkVersion=31 targetSdkVersion=31"
./gradlew bundleRelease
I get an error:
Task :app:processReleaseMainManifest FAILED
[:#react-native-firebase_config] /Users/butinproject/it-department/stable-android/kapibara_mobile_app/node_modules/#react-native-firebase/remote-config/android/build/intermediates/merged_manifest/release/AndroidManifest.xml Warning:
Package name 'io.invertase.firebase.config' used in: :#react-native-firebase_config, :react-native-firebase_remote-config.
[:#react-native-firebase_analytics] /Users/butinproject/it-department/stable-android/kapibara_mobile_app/node_modules/#react-native-firebase/analytics/android/build/intermediates/merged_manifest/release/AndroidManifest.xml Warning:
Package name 'io.invertase.firebase.analytics' used in: :#react-native-firebase_analytics, :react-native-firebase_analytics.
[:#react-native-firebase_perf] /Users/butinproject/it-department/stable-android/kapibara_mobile_app/node_modules/#react-native-firebase/perf/android/build/intermediates/merged_manifest/release/AndroidManifest.xml Warning:
Package name 'io.invertase.firebase.perf' used in: :#react-native-firebase_perf, :react-native-firebase_perf.
/Users/butinproject/it-department/stable-android/kapibara_mobile_app/android/app/src/main/AndroidManifest.xml Error:
Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Perhaps something else is needed to switch to Android 12?
try
changed in build.gradle file
"compileSdkVersion=31 targetSdkVersion=31"
./gradlew bundleRelease
Wanted to get:
build success
got instead: error
Task :app:processReleaseMainManifest FAILED

Android resource linking failed ( error: failed linking references.)

After i add GDPR code to my app in (MainActivity.java) seccion , After i try to rebuild project i get this error :
Android resource linking failed
C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found.
C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found.
C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
error: failed linking references.
I already checked her and i don't found any solution , Thank you
Look at the error reported:
values-v26.xml:7: error: resource android:attr/colorError not found
This one (and the next few) are all because these android attributes were only added in API 26 (that's why they're referenced from values-v26). You need to update your compileSdkVersion to at least 26, although I'd highly recommend updating to the newest API 28.
Edit your app level's build.gradle file:
android {
compileSdkVersion 28
...
}

Getting resource issue duplication related issue?

The error message is the following: android 'attr/value' with config ''
Here is the version setup:
compileSdkVersion = 27
buildToolsVersion = "27.0.3"
minSdkVersion = 21
targetSdkVersion = 27`
The error message specifies the name of loading-dots library, which has really less resources which doesn't interfere with the other resources.
The question is now how to parse this error message properly to a normal human understandable language to be able to find where the issue comes from.
What does mean?
- "attr/value"
- "with config ''"
Here is the complete log message
:app:generateDebugResources
AGPBI: {"kind":"error","text":"error: duplicate value for resource \u0027attr/value\u0027 with config \u0027\u0027.","sources":[{"file":"/Users/karate/.gradle/caches/transforms-1/files-1.1/loading-dots-1.0.2.aar/53c3c73936c7c0b67d125304a8d501c0/res/values/values.xml","position":{"startLine":3,"startColumn":4,"startOffset":619,"endColumn":60,"endOffset":675}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource previously defined here.","sources":[{"file":"/Users/karate/.gradle/caches/transforms-1/files-1.1/loading-dots-1.0.2.aar/53c3c73936c7c0b67d125304a8d501c0/res/values/values.xml","position":{"startLine":3,"startColumn":4,"startOffset":619,"endColumn":60,"endOffset":675}}],"original":"","tool":"AAPT"}
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED
The library has an issue, it clashes with a system xml attribute. That's why you are getting the error. Moreover, the repo you've linked to is backwards as it doesn't have a values.xml try to change the compile version to a lower figure. Maybe
compile 'com.eyalbira.loadingdots:loading-dots:1.0.0'

Android string resources not working with $

After upgrading to android studio 3.0.1 the string resources with $ in their name
like: <string name="$KEY$">value</string>
throw an error
Error:(615, 3) error: resource 'string/$KEY$' has invalid entry name '$KEY$'. Invalid character '$KEY$'.
trace is:
AGPBI: {"kind":"error","text":"error: resource
\u0027string/$KEY$\u0027 has invalid entry name \u0027$KEY$\u0027.
Invalid character
\u0027$KEY$\u0027.","sources":[{"file":"../src/main/res/values-es/strings.xml","position":{"startLine":559,"startColumn":2,"startOffset":60748,"endColumn":54,"endOffset":60800}}],"original":"","tool":"AAPT"}
Aapt2 is enabled by default when you use android plugin for gradle 3.0.
You can fix your issue by setting android.enableAapt2=false in your gradle.properties

No resource found that matches the given name [Eclipse]

I'm trying to fix a couple errors that I'm getting when trying to create a new Android Application Project in Eclipse.
The following errors occur:
[2016-11-17 15:22:52 - Chatter] C:\Users\Chris\AppData\Local\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
[2016-11-17 15:22:48 - Chatter]
[2016-11-17 15:22:48 - Chatter] C:\Users\Chris\AppData\Local\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
[2016-11-17 15:22:48 - Chatter]
I have tried the following things:
Imported android-support-v7-appcompat into the project. Also created the reference.
Changed project.properties > target from android-19 to android-21
My project setup:
Minimum required SDK: API 14
Target SDK: API 21
Compile with: API 21
Blank Activity - Default names for everything.

Categories

Resources