javah error: package does not exist with gradle and Android Studio - android-studio

I'm facing an error when compiling my Java sources to produce C++ headers recently: javah spits a package does not exist error for some file.
tl;dr: javah works fine for a Java source but not another one – which import clauses are pretty close; gradle does not process some libraries but even the packages of the processed ones get flagged as missing.
I don't know why javah has started spitting that error since it worked well until recently and I did not change anything special. I'm using gradle with Android Studio's gradle-wrapper. I recently updated the wrapper's distribution from 2.2.1 to 2.10 but I don't think that's why javah fails now.
According to the logs and the present files, javah doesn't find the packages from libraries I'm using as it compiles ClassB but not ClassA.
Let's take two examples: com.batch.android and com.adjust.sdk
com.batch.android library does get processed by gradle so its jars are in my build/intermediates/exploded-aar folder (under com.batch.android/batch-sdk/1.5.3/jars/classes.jar and com.batch.android/batch-sdk/1.5.3/jars/libs/batch.jar)
com.adjust.sdk library does not get processed by gradle so its jars are not in my build/intermediates/exploded-aar
both are in my ~/.gradle/cache/ folder
both packages fail as missing by javah
both packages are not imported from ClassA and ClassB java files
Thanks for your help!
The gradle logs (sorry guys, it's super long):
Executing tasks: [:app:clean, :app:generateDevAmazonDebugSources, :app:generateDevAmazonDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDevAmazonDebugUnitTestDependencies, :app:assembleDevAmazonDebug]
Configuration on demand is an incubating feature.
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
Generating assets binaries
Incremental java compilation is an incubating feature.
Cleaning project...
:app:clean
:app:processAssets
:app:copyFiles
:app:preBuild
:app:preDevAmazonDebugBuild
:app:checkDevAmazonDebugManifest
:app:preDevAmazonReleaseBuild
:app:preDevGoogleDebugBuild
:app:preDevGoogleReleaseBuild
:app:preProdAmazonDebugBuild
:app:preProdAmazonReleaseBuild
:app:preProdGoogleDebugBuild
:app:preProdGoogleReleaseBuild
:app:prepareComAndroidSupportAppcompatV72311Library
:app:prepareComAndroidSupportCardviewV72320Library
:app:prepareComAndroidSupportMediarouterV72220Library
:app:prepareComAndroidSupportMultidex100Library
:app:prepareComAndroidSupportRecyclerviewV72311Library
:app:prepareComAndroidSupportSupportV42320Library
:app:prepareComBatchAndroidBatchSdk153Library
:app:prepareComCrashlyticsSdkAndroidAnswers136Library
:app:prepareComCrashlyticsSdkAndroidBeta114Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics255Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsNdk112Library
:app:prepareComFacebookAndroidFacebookAndroidSdk4101Library
:app:prepareComGoogleAndroidExoplayerExoplayerR142Library
:app:prepareComGoogleAndroidGmsPlayServices780Library
:app:prepareComGoogleAndroidGmsPlayServicesAds780Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics780Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing780Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite780Library
:app:prepareComGoogleAndroidGmsPlayServicesAppstate780Library
:app:prepareComGoogleAndroidGmsPlayServicesBase780Library
:app:prepareComGoogleAndroidGmsPlayServicesCast780Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive780Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness780Library
:app:prepareComGoogleAndroidGmsPlayServicesGames780Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm780Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity780Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation780Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps780Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby780Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama780Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus780Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet780Library
:app:prepareComGoogleAndroidGmsPlayServicesVision780Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet780Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable780Library
:app:prepareComMopubMopubSdk440Library
:app:prepareComZendeskBelvedere1011Library
:app:prepareComZendeskSdk1512Library
:app:prepareComZendeskSdkProviders1512Library
:app:prepareIoBranchSdkAndroidLibrary1112Library
:app:prepareIoFabricSdkAndroidFabric1310Library
:app:prepareDevAmazonDebugDependencies
:app:compileDevAmazonDebugAidl
:app:compileDevAmazonDebugRenderscript
:app:generateDevAmazonDebugBuildConfig
:app:generateDevAmazonDebugAssets UP-TO-DATE
:app:mergeDevAmazonDebugAssets
:app:processDevAmazonDebugManifest
:app:fabricGenerateResourcesDevAmazonDebug
:app:generateDevAmazonDebugResValues UP-TO-DATE
:app:processDevAmazonDebugGoogleServices
:app:generateDevAmazonDebugResources
:app:mergeDevAmazonDebugResources
:app:processDevAmazonDebugResources
:app:generateDevAmazonDebugSources
:app:preDevAmazonDebugAndroidTestBuild
:app:prepareDevAmazonDebugAndroidTestDependencies
:app:compileDevAmazonDebugAndroidTestAidl
:app:processDevAmazonDebugAndroidTestManifest
:app:compileDevAmazonDebugAndroidTestRenderscript
:app:generateDevAmazonDebugAndroidTestBuildConfig
:app:generateDevAmazonDebugAndroidTestAssets UP-TO-DATE
:app:mergeDevAmazonDebugAndroidTestAssets
:app:generateDevAmazonDebugAndroidTestResValues UP-TO-DATE
:app:generateDevAmazonDebugAndroidTestResources
:app:mergeDevAmazonDebugAndroidTestResources
:app:processDevAmazonDebugAndroidTestResources
:app:generateDevAmazonDebugAndroidTestSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDevAmazonDebugUnitTestBuild
:app:prepareDevAmazonDebugUnitTestDependencies
:app:javahBuild_ClassA
:app:javahBuild_ClassB
Error: package com.adjust.sdk does not exist
Error: package com.adjust.sdk does not exist
Error: package com.amazon.ags.api does not exist
Error: package com.batch.android does not exist
Error: package com.batch.android does not exist
Error: package com.crashlytics.android does not exist
Error: package com.crashlytics.android.answers does not exist
Error: package com.crashlytics.android.answers does not exist
Error: package com.crashlytics.android.answers does not exist
Error: package com.mopub.common does not exist
Error: package com.zendesk.sdk.feedback.impl does not exist
Error: package com.zendesk.sdk.model.access does not exist
Error: package com.zendesk.sdk.model.access does not exist
Error: package com.zendesk.sdk.model.push does not exist
Error: package com.zendesk.sdk.network.impl does not exist
Error: package com.zendesk.sdk.network.impl does not exist
Error: package com.zendesk.sdk.network.impl does not exist
Error: package com.zendesk.sdk.network.impl does not exist
Error: package com.zendesk.sdk.network.impl does not exist
Error: package com.zendesk.sdk.requests does not exist
Error: package com.zendesk.sdk.storage does not exist
Error: package com.zendesk.sdk.support does not exist
Error: package com.zendesk.service does not exist
Error: package com.zendesk.service does not exist
Error: package org.joda.time does not exist
Error: package org.joda.time does not exist
Error: package org.joda.time does not exist
Error: package org.joda.time does not exist
Error: package org.joda.time.format does not exist
Error: package org.joda.time.format does not exist
Error: package io.branch.indexing does not exist
Error: package io.branch.referral does not exist
Error: package io.branch.referral does not exist
Error: package io.branch.referral does not exist
Error: package io.branch.referral.util does not exist
Error: package io.branch.referral.util does not exist
Error: package com.adjust.sdk does not exist
Error: package com.amazon.ags.api does not exist
Error: package com.amazon.ags.api does not exist
Error: package com.amazon.ags.api does not exist
Error: package com.amazon.ags.api does not exist
Error: package com.applovin.sdk does not exist
Error: package com.batch.android does not exist
Error: package com.crashlytics.android does not exist
Error: package com.crashlytics.android.ndk does not exist
Error: package io.branch.referral does not exist
Error: package io.branch.referral does not exist
Error: package io.fabric.sdk.android does not exist
Error: package com.google.android.gms.analytics does not exist
Error: package com.google.android.gms.analytics does not exist
Error: package com.google.android.gms.analytics does not exist
Error: package com.google.android.gms.ads.identifier does not exist
Error: package com.google.android.gms.common does not exist
Error: package com.mopub.common does not exist
Error: package com.mopub.common does not exist
Error: cannot find symbol
symbol: class MoPubErrorCode
location: package com.mopub.mobileads
Error: cannot find symbol
symbol: class MoPubRewardedVideoListener
location: package com.mopub.mobileads
Error: package com.chartboost.sdk does not exist
Error: package com.adjust.sdk does not exist
Error: package com.adjust.sdk does not exist
Error: package com.adjust.sdk does not exist
Error: package com.adjust.sdk does not exist
Error: cannot find symbol
symbol: class BaseZendeskFeedbackConfiguration
location: class my.super.project.Renderer
Error: cannot find symbol
symbol: class BuildConfig
location: package my.super.project
Error: cannot find symbol
symbol: class Tracker
location: class my.super.project.Main
Error: ';' expected
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook does not exist
Error: package com.facebook.appevents does not exist
Error: package com.facebook.login does not exist
Error: package com.facebook.login does not exist
Error: package com.facebook.share.model does not exist
Error: package com.facebook.share.model does not exist
Error: package com.facebook.share.model does not exist
Error: package com.facebook.share.widget does not exist
Error: package com.facebook.share.widget does not exist
Error: package com.facebook.share.widget does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j does not exist
Error: package twitter4j.auth does not exist
Error: cannot find symbol
symbol: class R
location: package my.super.project
Error: cannot find symbol
symbol: class AmazonGamesClient
location: class my.super.project.Main
Error: cannot find symbol
symbol: class MoPubRewardedVideoListener
location: class my.super.project.Main
Error: cannot find symbol
symbol: class ChartBoostDelegate
location: class my.super.project.Main
Error: cannot find symbol
symbol: class CallbackManager
location: class my.super.project.ClassA
Error: cannot find symbol
symbol: class ProfileTracker
location: class my.super.project.ClassA
FAILED
FAILURE: Build failed with an exception.
My build.gradle has the following tasks:
android {
<snip>
['Main', 'Renderer', 'ClassA', 'ClassB'].each {
def targetName ->
tasks.create(name: "javahBuild_$targetName", type: Exec) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
String sdkDir = properties.getProperty('sdk.dir')
String flavorFolder = getCurrentFlavorFolder()
commandLine 'javah', '-classpath', "libs/:src/main/java/:$sdkDir/platforms/android-23/android.jar:build/intermediates/classes/$flavorFolder/$config:$sdkDir/platforms/android-23/optional/org.apache.http.legacy.jar/:$config/", '-d', 'src/main/jni/Main/', "my.super.project.${targetName}"
}
}
task javahBuildAll(dependsOn: tasks.matching { Task task -> task.name.startsWith("javahBuild_") })
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn javahBuildAll
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.2#aar') {
transitive = true
}
compile('com.mopub:mopub-sdk:4.4.0#aar') {
transitive = true
}
compile group: 'com.zendesk', name: 'sdk', version: '1.5.1.2'
compile('com.android.support:multidex:1.0.0')
compile('com.google.android.gms:play-services:7.8.0')
compile('com.google.android.gms:play-services-analytics:7.8.0')
compile('com.google.android.gms:play-services-gcm:7.8.0')
compile('com.android.support:appcompat-v7:23.1.0')
compile('com.android.support:support-v4:23.1.0')
compile('com.facebook.android:facebook-android-sdk:4.10.+')
compile('io.branch.sdk.android:library:1.+')
compile('com.batch.android:batch-sdk:1.5+')
compile('com.adjust.sdk:adjust-android:4.2.3')
compile('joda-time:joda-time:2.9.2')
}

OK it didn't understand why I'm getting those errors but I just realized I could ignore them since the C++ header files are still getting generated.
So I decide to modify my javah gradle task to ignore errors and write those into a dedicated log file. I've added the following line:
errorOutput = project.file("build/javah_error_${targetName}.log").newDataOutputStream()
ignoreExitValue = true
My javah task now looks like this:
['Main', 'Renderer', 'ClassA', 'ClassB'].each {
def targetName ->
tasks.create(name: "javahBuild_$targetName", type: Exec) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
String sdkDir = properties.getProperty('sdk.dir')
String flavorFolder = getCurrentFlavorFolder()
errorOutput = project.file("build/javah_error_${targetName}.log").newDataOutputStream()
ignoreExitValue = true
commandLine 'javah', '-classpath', "libs/:src/main/java/:$sdkDir/platforms/android-23/android.jar:build/intermediates/classes/$flavorFolder/$config:$sdkDir/platforms/android-23/optional/org.apache.http.legacy.jar/:$config/", '-d', 'src/main/jni/Main/', "my.super.project.${targetName}"
}
}

After multiple hours of searching, researching, trial and error, and other things, I’ve finally got it.
javah is gone, one must use javac […] -h <destdir> […] now.
I already had the following snippet in my top-level build.gradle (not the one under app/ or so!) to add javac arguments…
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all"
}
… and “just” had to extend that. (This section goes into the allprojects { block which you already have in your top-level build.gradle, I put it after the repositories { […] } block.)
In my case, I merely wanted to let the .h files be created but not actively #include them in the C code (because I use the RegisterNatives method to register my functions), which would be… tricky, as one would additionally to this have to:
figure out which of the (possibly multiple) tasks should create the .h files used in the actual build
give that a stable pathname
add that path to the include directories in the native build (again tricky)
For mere manual introspection, I just add the javac -h <destdir> option to all javac invocations, creating per-task result directories, and then just look at them in Midnight Commander:
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all"
options.getHeaderOutputDirectory().value(project.layout.buildDirectory.dir("headers/" + getName()))
}
(The compilerArgs change is, of course, copied unchanged from the above.)

Related

Unable to use the Ipfy API in Android Studio

https://github.com/chintan369/Ipify-Android
I have followed the instructions to load all the dependencies and everything but it tells me that Ipfy.init() cannot resolve symbol
C:\Users\aniru\StudioProjects\Android1\app\src\main\java\com\example\mytoyvpn\ToyVpnClient.java:54: error: cannot find symbol
new Ipfy.init(this);
^
symbol: class init
location: class Ipfy

app:compileDebugJavaWithJavac task failing, erroring out on its own code

I'm getting this error after running npx react-native run-android, and I'm new to react and node in general so I'm not sure what could be going on.
gradle build --warning-mode all runs successfully with no issue. Not sure what could be going on. Running react-native upgrade doesn't help as suggested in similar questions, but it does give the error "Accessing non-existent property 'padLevels' of module exports inside circular dependency", though I think it's unrelated.
I'm on npm 6.14.10, node v14.15.4, Gradle 6.4, react-native-cli 2.0.1, react-native 0.63.4, openjdk 14.0.2
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4/userguide/command_line_interface.html#sec:command_line_warnings
106 actionable tasks: 2 executed, 104 up-to-date
/android/app/src/main/java/com/test/MainApplication.java:20: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
/android/app/src/main/java/com/test/MainApplication.java:59: error: cannot find symbol
if (BuildConfig.DEBUG) {
^
symbol: variable BuildConfig
location: class MainApplication
/android/app/src/main/java/com/test/MainApplication.java:59: error: illegal parenthesized expression
if (BuildConfig.DEBUG) {
^
Note: /android/app/src/debug/java/com/test/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

How do i fix this error of 'simple_permissions' on flutter?

There is an error when I run the code including simple_permissions on flutter project.
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
^
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:156: error: cannot find symbol
ActivityCompat.requestPermissions(activity, perm, 0);
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:163: error: cannot find symbol
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
^
symbol: variable ContextCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:171: error: cannot find symbol
if (ActivityCompat.shouldShowRequestPermissionRationale(registrar.activity(), permission)) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:175: error: cannot find symbol
if (ActivityCompat.checkSelfPermission(registrar.context(), permission) == PackageManager.PERMISSION_GRANTED) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':simple_permissions:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
*******************************************************************************************
I was getting the same issue, after some searches I found this repository.
https://github.com/tq-systems/simple_permissions
This repository solved the AndroidX compatibility issues.
import it into the pubspec.yaml like that:
dependencies:
simple_permissions:
git:
url: https://github.com/tq-systems/simple_permissions.git
I got the same issue. I solved it with these step
Step 1 => Update your android studio to lastest version
download here
Step 2
Uninstall your android studio and install the new with new setting
Step 3
Add the Flutter plugin
Step 4
Add this to your depences in build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath ('com.google.firebase:firebase-plugins:1.1.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
}
Step 5
Run this command
flutter packages get
To update your packages and gradles
It worked fine for me.

Bazel doesn't find tensorflow packages for C++ example code

I try to make this example work, but everytime I try to build the program with bazel I get this error message:
bazel build //code:label_image
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: Analysis of target '//code:label_image' failed; build aborted.
INFO: Elapsed time: 1.261s
I saved the exact source code from github in a directory called code. I installed tensorflow in an (active) virtual environment via pip: pip3 install --upgrade tensorflow. I use arch linux.
Why doesn't bazel find the proper packages? I'm quite new to bazel/tensorflow. Where are these packages saved? Do I have to specify them explicitely somewhere?
Typically, extracting a subfolder from a project that uses Bazel and building it separately does not work.
If you look into the BUILD file of the label_image folder, you will see this definition for a C++ binary:
cc_binary(
name = "label_image",
srcs = [
"main.cc",
],
linkopts = select({
"//tensorflow:android": [
"-pie",
"-landroid",
"-ljnigraphics",
"-llog",
"-lm",
"-z defs",
"-s",
"-Wl,--exclude-libs,ALL",
],
"//conditions:default": ["-lm"],
}),
deps = select({
"//tensorflow:android": [
# cc:cc_ops is used to include image ops (for label_image)
# Jpg, gif, and png related code won't be included
"//tensorflow/cc:cc_ops",
"//tensorflow/core:android_tensorflow_lib",
# cc:android_tensorflow_image_op is for including jpeg/gif/png
# decoder to enable real-image evaluation on Android
"//tensorflow/core/kernels:android_tensorflow_image_op",
],
"//conditions:default": [
"//tensorflow/cc:cc_ops",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:tensorflow",
],
}),
)
This rule tells Bazel what the label_image binary requires to be built. Notably, it has dependencies (deps) and link options (linkopts) that point to the root of the tensorflow workspace (//tensorflow, defined by the WORKSPACE file), which is missing from your extracted subfolder. This is the reason why Bazel is complaining that it cannot find the package tensorflow.
The easiest way to build the label_image binary is to build it from within the tensorflow project, since the paths are already set up.

gcc-3.4 compilation error

I need gcc-3.4 for compilation f some software.
I installed on my Ubuntu-12.4 using following instruction :--
https://superuser.com/questions/351742/how-to-install-gcc-3-4-on-ubuntu-11-10
sudo dpkg -i *.deb
gcc-3.4 hello.c
I compiled simple hello program.
Then in the rpi_exp.c where, #include<stdio.h> begins i get lots of error.
It seems as if libc is not found.
Please suggest is it the right package to install for this ?
There are many libraries here which one to install :?:
http://packages.ubuntu.com/hardy-updates/gcc-3.4
https://ftp7.de.netbsd.org/pub/releases.ubuntu.com/ubuntu/pool/main/g/glibc/
http://packages.ubuntu.com/hardy-updates/i386/libc6-i686/download
Error :--
ignite#ignite:~/testing$ gcc-3.4 rpi_exp.c
In file included from /usr/include/stdio.h:28,
from rpi_exp.c:1:
/usr/include/features.h:324:26: bits/predefs.h: No such file or directory
/usr/include/features.h:357:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:389:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:34,
from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from rpi_exp.c:1:
/usr/include/stdio.h:36:25: bits/types.h: No such file or directory
In file included from rpi_exp.c:1:
/usr/include/stdio.h:49: error: syntax error before "typedef"
/usr/include/stdio.h:54: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:65: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:75,
from rpi_exp.c:1:
rpi_exp.c :---
#include <stdio.h>
int main()
{
printf("Hello, world!\n");
return 0;
}
I tried installing gcc-3.4 referring :----
http://simplyrisc.blogspot.in/2009/11/install-gcc-34-on-ubuntu-910.html
Error Got :---
>> ignite#ignite:~/testing$ sudo dpkg -i *.deb
Reading database ... 159968 files and directories currently installed.)
Preparing to replace cpp-3.4 3.4.6-6ubuntu3 (using cpp-3.4_3.4.6-8ubuntu2_i386.deb) ...
Unpacking replacement cpp-3.4 ...
Selecting previously unselected package g++-3.4.
Unpacking g++-3.4 (from g++-3.4_3.4.6-6ubuntu3_i386.deb) ...
Selecting previously unselected package gcc-3.4.
Unpacking gcc-3.4 (from gcc-3.4_3.4.6-8ubuntu2_i386.deb) ...
Preparing to replace gcc-3.4-base 3.4.6-6ubuntu3 (using gcc-3.4-base_3.4.6-8ubuntu2_i386.deb) ...
Unpacking replacement gcc-3.4-base ...
Selecting previously unselected package libstdc++6-dev.
Unpacking libstdc++6-dev (from libstdc++6-dev_3.4.6-6ubuntu3_i386.deb) ...
dpkg: dependency problems prevent configuration of g++-3.4:
g++-3.4 depends on gcc-3.4 (= 3.4.6-6ubuntu3); however:
Version of gcc-3.4 on system is 3.4.6-8ubuntu2.
g++-3.4 depends on gcc-3.4-base (= 3.4.6-6ubuntu3); however:
Version of gcc-3.4-base on system is 3.4.6-8ubuntu2.
dpkg: error processing g++-3.4 (--install):
dependency problems - leaving unconfigured
Setting up gcc-3.4-base (3.4.6-8ubuntu2) ...
dpkg: dependency problems prevent configuration of libstdc++6-dev:
libstdc++6-dev depends on g++-3.4 (= 3.4.6-6ubuntu3); however:
Package g++-3.4 is not configured yet.
libstdc++6-dev depends on gcc-3.4-base (= 3.4.6-6ubuntu3); however:
Version of gcc-3.4-base on system is 3.4.6-8ubuntu2.
dpkg: error processing libstdc++6-dev (--install):
dependency problems - leaving unconfigured
Setting up cpp-3.4 (3.4.6-8ubuntu2) ...
Processing triggers for man-db ...
Setting up gcc-3.4 (3.4.6-8ubuntu2) ...
Errors were encountered while processing:
g++-3.4
libstdc++6-dev
--------------------------- [EDIT] :--------------------------
Please help me what is getting wrong.
I need it to compile QEmu.
I again re-installed from following link, no warning no error :------
https://launchpad.net/ubuntu/+archive/primary/+sourcepub/277794/+listing-archive-extra
cpp-3.4_3.4.6-6ubuntu3_i386.deb
g++-3.4_3.4.6-6ubuntu3_i386.deb
gcc-3.4_3.4.6-6ubuntu3_i386.deb
gcc-3.4-base_3.4.6-6ubuntu3_i386.deb
libstdc++6-dev_3.4.6-6ubuntu3_i386.deb
Program crashes again :-----
ignite#ignite:~/testing$ gcc-3.4 rpi_exp.c
In file included from /usr/include/stdio.h:28,
from rpi_exp.c:1:
/usr/include/features.h:324:26: bits/predefs.h: No such file or directory
/usr/include/features.h:357:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:389:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:34,
from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from rpi_exp.c:1:
/usr/include/stdio.h:36:25: bits/types.h: No such file or directory
In file included from rpi_exp.c:1:
/usr/include/stdio.h:49: error: syntax error before "typedef"
/usr/include/stdio.h:54: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:65: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:75,
from rpi_exp.c:1:
/usr/include/wchar.h:95: error: storage class specified for parameter `__mbstate_t'
In file included from /usr/include/libio.h:32,
from /usr/include/stdio.h:75,
from rpi_exp.c:1:
/usr/include/_G_config.h:24: error: syntax error before "__off_t"
/usr/include/_G_config.h:29: error: syntax error before "__off64_t"
/usr/include/_G_config.h:53: error: storage class specified for parameter `_G_int16_t'
/usr/include/_G_config.h:54: error: storage class specified for parameter `_G_int32_t'
/usr/include/_G_config.h:55: error: storage class specified for parameter `_G_uint16_t'
/usr/include/_G_config.h:56: error: storage class specified for parameter `_G_uint32_t'
In file included from /usr/include/libio.h:53,
from /usr/include/stdio.h:75,
from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stdarg.h:43: error: storage class specified for parameter `__gnuc_va_list'
In file included from /usr/include/stdio.h:75,
from rpi_exp.c:1:
/usr/include/libio.h:182: error: storage class specified for parameter `_IO_lock_t'
/usr/include/libio.h:302: error: syntax error before "__off_t"
/usr/include/libio.h:312: error: syntax error before "_IO_lock_t"
/usr/include/libio.h:340: error: syntax error before '}' token
/usr/include/libio.h:343: error: storage class specified for parameter `_IO_FILE'
/usr/include/libio.h:348: error: storage class specified for parameter `_IO_2_1_stdin_'
/usr/include/libio.h:349: error: storage class specified for parameter `_IO_2_1_stdout_'
/usr/include/libio.h:350: error: storage class specified for parameter `_IO_2_1_stderr_'
/usr/include/libio.h:366: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:366: error: syntax error before "__io_read_fn"
/usr/include/libio.h:374: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:374: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:366: error: previous definition of '__ssize_t' was here
/usr/include/libio.h:374: error: syntax error before "__io_write_fn"
/usr/include/libio.h:383: error: syntax error before "__off64_t"
/usr/include/libio.h:383: error: storage class specified for parameter `__io_seek_fn'
/usr/include/libio.h:386: error: storage class specified for parameter `__io_close_fn'
/usr/include/libio.h:418: error: syntax error before '*' token
/usr/include/libio.h:418: error: storage class specified for parameter `__underflow'
Please help me what is getting wrong.
Your error means your files aren't matched in version.
you should install gcc-3.4 having all these following .deb files:
cpp-3.4_3.4.6-6ubuntu5_i386.deb
g++-3.4_3.4.6-6ubuntu5_i386.deb
gcc-3.4_3.4.6-6ubuntu5_i386.deb
gcc-3.4-base_3.4.6-6ubuntu5_i386.deb
libstdc++6-dev_3.4.6-6ubuntu5_i386.deb
install them by the following command:
dpkg -i *.deb
Good Luck ;)

Resources